文件服务-文件目录/下载功能

This commit is contained in:
zhujiyan
2024-08-30 16:34:06 +08:00
parent 2c59406871
commit 64d82adb57
5 changed files with 365 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
import createAxios from '@/utils/request'
// 设备文件根目录查询
export function getDeviceRootPath(nDid) {
return createAxios({
url: '/cs-device-boot/deviceFile/askDeviceRootPath?nDid=' + nDid,
method: 'POST'
})
}
// 设备文件-目录信息询问
export function getFileServiceFileOrDir(data) {
return createAxios({
url: `cs-device-boot/deviceFile/askDeviceFileOrDir?nDid=${data.nDid}&name=${data.name}&type=${data.type}`,
method: 'POST'
})
}
//设备文件下载
export function downLoadDeviceFile(data) {
return createAxios({
url: `/cs-device-boot/deviceFile/downloadFile?nDid=${data.nDid}&name=${data.name}&fileCheck=${data.fileCheck}&size=${data.size}`,
method: 'POST'
})
}
//上传文件至装置
export function uploadDeviceFile(data) {
let form = new FormData()
form.append('file', data.file)
form.append('filePath', data.filePath)
form.append('id', data.id)
return createAxios({
url: `/access-boot/analyzeModel/uploadDevFile`,
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form
})
}