This commit is contained in:
ky_sunl
2021-04-23 07:52:22 +00:00
parent 0704d01146
commit 25da12c950
7 changed files with 14 additions and 9208 deletions

View File

@@ -117,16 +117,24 @@ for (let key in urls) {
reslove([ArrayBuffer, Blob].indexOf(data.constructor) > -1 ? res : data)
}
})
.catch(({ response: { data } }) => {
.catch(({ response }) => {
if (process.env.VUE_APP_NODE_ENV === 'development') {
errorNotification(data)
const { data, status } = response
if (data.constructor === String) {
errorNotification({
message: data,
code: status
})
} else {
errorNotification(data)
}
reject(data)
if (data.code === status.Unauthorized) {
handlerUnauthorized()
}
} else {
errorNotification({
message: '发生错误,请联系管理员'
message: '系统发生错误,请联系管理员'
})
}
})