批量导入被检设备
This commit is contained in:
@@ -42,7 +42,7 @@ class RequestHttp {
|
||||
config.loading ?? (config.loading = true)
|
||||
config.loading && showFullScreenLoading()
|
||||
if (config.headers && typeof config.headers.set === 'function') {
|
||||
config.headers.set('Authorization', 'Bearer '+userStore.token)
|
||||
config.headers.set('Authorization', 'Bearer ' + userStore.token)
|
||||
}
|
||||
return config
|
||||
},
|
||||
@@ -63,7 +63,7 @@ class RequestHttp {
|
||||
// 登陆失效
|
||||
if (data.code == ResultEnum.OVERDUE) {
|
||||
userStore.setToken('')
|
||||
userStore.setUserInfo({name: ''})
|
||||
userStore.setUserInfo({ name: '' })
|
||||
router.replace(LOGIN_URL)
|
||||
ElMessage.error(data.message)
|
||||
return Promise.reject(data)
|
||||
@@ -115,9 +115,24 @@ class RequestHttp {
|
||||
}
|
||||
|
||||
upload(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||
return this.service.post(url, params, { ..._object, headers: { 'Content-Type': 'multipart/form-data' } })
|
||||
return this.service.post(url, params, {
|
||||
..._object,
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对excel的上传,默认返回的是blob类型,Excel没问题时返回json特殊处理
|
||||
*/
|
||||
uploadExcel(url: string, params?: object, _object = {}): Promise<BlobPart> {
|
||||
return this.service.post(url, params, {
|
||||
..._object,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
responseType: 'blob',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default new RequestHttp(config)
|
||||
|
||||
Reference in New Issue
Block a user