fix: axios 响应拦截错误提示
This commit is contained in:
parent
fe50d7b3f2
commit
463cdd2ae1
@ -39,8 +39,9 @@ instance.interceptors.request.use(
|
|||||||
instance.interceptors.response.use(
|
instance.interceptors.response.use(
|
||||||
(response: any) => {
|
(response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
if (response.status !== 200 && !(response.data instanceof Blob)) {
|
if (response.data.code !== 200 && !(response.data instanceof Blob)) {
|
||||||
MsgError(response.data.message)
|
MsgError(response.data.message)
|
||||||
|
return Promise.reject(response.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user