Browse Source

feat:fix bugs

dev
zhaobing’ 1 year ago
parent
commit
7c8661e992
  1. 7
      api/config.js
  2. 9
      web/client/src/sections/firmwareUpgrade/components/addFirmwareModal.jsx

7
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,

9
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) => {
<Form.Select disabled={recordRow?true:false} field='deviceName' label='设备型号:' placeholder='请选择设备型号' optionList={options} rules={[{ required: true, message: '设备型号必填' }]}></Form.Select>
<Form.Input disabled={recordRow?true:false} field='versionNo' label='版本号:' rules={[{ required: true, message: '版本号必填' }]}></Form.Input>
<Form.Upload limit={1}
action={`/_upload/attachments`}
field='files' label='文件上传'
action={`${apiRoot}/attachments/p`}
field='files' label='文件上传'
rules={[{ required: true, message: '文件上传必填' }]}
onRemove={() => {
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
};
}

Loading…
Cancel
Save