From 7c8661e9923a501503f70352cb654654b69e883f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Wed, 1 Nov 2023 11:40:37 +0800 Subject: [PATCH] feat:fix bugs --- api/config.js | 7 ++++++- .../firmwareUpgrade/components/addFirmwareModal.jsx | 9 +++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/config.js b/api/config.js index efd6e63..372508b 100644 --- a/api/config.js +++ b/api/config.js @@ -151,6 +151,9 @@ const ANXINCLOUD_ES_NODES_REST = process.env.ANXINCLOUD_ES_NODES_REST || flags.e // //business_key // const BUSINESS_KEY=process.env.BUSINESS_KEY||['160','161'] +//文件上传类型限制(主要是固件升级上传固件包) +const TYPES= process.env.TYPES&&process.env.TYPES.split(',')||['.bin'] + const requireParams = { FS_CAMUNDA_HOST, FS_CAMUNDA_ROOT, POMS_DB, @@ -168,7 +171,8 @@ const requireParams = { CONFIRM_ALARM_ANXIN_USER_ID, VCMP_APP_ID, VCMP_APP_SECRET, API_CRAW_URL, - // CLICKHOUST_DATA_ALARM_LOCAL + // CLICKHOUST_DATA_ALARM_LOCAL, + TYPES } Object.keys(requireParams).forEach(key => { @@ -193,6 +197,7 @@ const product = { secretKey: QINIU_SK }, maxSize: 104857600, // 100M + types:TYPES } }, { entry: require('./app').entry, diff --git a/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx b/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx index 9f9ec35..20de846 100644 --- a/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx +++ b/web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx @@ -6,7 +6,7 @@ import { IconUpload,IconVigoLogo } from '@douyinfe/semi-icons'; import request from 'superagent'; const AddFirmwareModal = (props) => { - const {modalVis,onCancel,crawapi,recordRow,actions,dispatch,qiniu} =props + const {modalVis,onCancel,crawapi,recordRow,actions,dispatch,qiniu,apiRoot} =props const api = useRef(); const {domain}=qiniu //七牛服务器地址 const {firmwareUpgrade}=actions @@ -113,14 +113,14 @@ const AddFirmwareModal = (props) => { { setUploadData({}) setRemoveFlag(true) }} - accept={'.bin'} + // accept={'.txt, .doc, .docx, .xls, .xlsx, .pdf, .png, .jpg, .rar, .zip, .bin'} onSuccess={(responseBody, file,all) => { // console.log('file111',file) setFileObj(file) @@ -154,6 +154,7 @@ function mapStateToProps (state) { actions: global.actions, crawapi: global.crawapi, qiniu:global.qiniu, + apiRoot: global.apiRoot }; }