|
|
@ -1,7 +1,7 @@ |
|
|
|
import React, { useState, useEffect, useRef } from 'react' |
|
|
|
import { connect } from 'react-redux'; |
|
|
|
import moment from 'moment' |
|
|
|
import { Button, Table, Modal, Form,Notification,Upload } from '@douyinfe/semi-ui'; |
|
|
|
import { Button, Table, Modal, Form,Notification,Upload,Toast } from '@douyinfe/semi-ui'; |
|
|
|
import { IconUpload } from '@douyinfe/semi-icons'; |
|
|
|
import request from 'superagent'; |
|
|
|
|
|
|
@ -54,7 +54,7 @@ const AddFirmwareModal = (props) => { |
|
|
|
const blobData = responseData.body; |
|
|
|
request.post(crawapi+'/firmwareupgrade') |
|
|
|
// .set('Content-Type','application/octet-stream') |
|
|
|
.attach('file',blobData,fileObj?.name||'') |
|
|
|
.attach('file',blobData,removeFlag?fileObj.name:recordRow?recordRow.firmwareName:fileObj.name) |
|
|
|
.field('filePath',removeFlag?fileUrl:recordRow?recordRow.filepath:fileUrl) |
|
|
|
.field('userId', userId||'') |
|
|
|
.field('comment',res?.remark||'') |
|
|
@ -62,6 +62,10 @@ const AddFirmwareModal = (props) => { |
|
|
|
.query({ version:res?.versionNo,device_meta_id: res?.deviceName,token:'22767e1f-db8d-4a1d-87d4-56347cf21247'}) |
|
|
|
.end((err, response) => { |
|
|
|
if(response?.ok){ |
|
|
|
Toast.info({ |
|
|
|
content: recordRow?'编辑成功':'新增成功', |
|
|
|
duration: 3, |
|
|
|
}) |
|
|
|
setRemoveFlag(false) |
|
|
|
onCancel() |
|
|
|
}else{ |
|
|
|