diff --git a/jjb.config.js b/jjb.config.js index 8c58ad4..a384d58 100644 --- a/jjb.config.js +++ b/jjb.config.js @@ -10,7 +10,7 @@ module.exports = { javaGitBranch: "dev", // 本地联调 safetyEval-service(context-path: /safetyEval,默认端口 8095) // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 - API_HOST: "http://192.168.0.152", + API_HOST: "http://192.168.0.103", }, production: { // 应用后端分支名称,部署上线需要 diff --git a/src/components/AttachmentUpload/index.js b/src/components/AttachmentUpload/index.js index a3da783..16f6684 100644 --- a/src/components/AttachmentUpload/index.js +++ b/src/components/AttachmentUpload/index.js @@ -59,9 +59,17 @@ export default function AttachmentUpload({ name, label, disabled = false, maxCou action={`${window.process.env.app.API_HOST}/safetyEval/file/upload`} beforeUpload={(file) => { if (!accept) return true; - const exts = accept.split(",").map((e) => e.trim().toLowerCase()); + const rules = accept.split(",").map((e) => e.trim().toLowerCase()); const ext = "." + file.name.split(".").pop().toLowerCase(); - if (!exts.includes(ext)) { + const matchExt = rules.includes(ext); + const matchMime = rules.some((r) => { + if (r.endsWith("/*")) { + const prefix = r.slice(0, -1); + return file.type && file.type.toLowerCase().startsWith(prefix); + } + return false; + }); + if (!matchExt && !matchMime) { message.error(`仅支持 ${accept} 格式文件`); return Upload.LIST_IGNORE; } diff --git a/src/pages/Container/EnterpriseInfo/EquipInfo/index.js b/src/pages/Container/EnterpriseInfo/EquipInfo/index.js index 3f210e8..6c9833b 100644 --- a/src/pages/Container/EnterpriseInfo/EquipInfo/index.js +++ b/src/pages/Container/EnterpriseInfo/EquipInfo/index.js @@ -116,6 +116,7 @@ function EquipInfoPage(props) { label="设备名称" placeholder="请输入" allowClear + maxLength={30} /> ,