|
@@ -42,7 +42,7 @@ service.interceptors.request.use(
|
|
|
// response interceptor
|
|
|
// eslint-disable-next-line complexity
|
|
|
service.interceptors.response.use((response) => {
|
|
|
- if (response.statusCode == 200) {
|
|
|
+ if (response.status == 200) {
|
|
|
if ((response.data.code === '200') || (response.data.code === '')) {
|
|
|
return response.data
|
|
|
} else if ((response.data.code === '20004') || (response.data.code === '20005') || (response.data.code == 40005)) { // 有res.data
|
|
@@ -69,7 +69,7 @@ service.interceptors.response.use((response) => {
|
|
|
return Promise.reject(response)
|
|
|
} // 没有res.data
|
|
|
Message({
|
|
|
- message: `请求错误:${response.errMsg}`,
|
|
|
+ message: `请求错误:${response.statusText}`,
|
|
|
type: 'error',
|
|
|
duration: 5 * 1000
|
|
|
})
|
|
@@ -77,7 +77,7 @@ service.interceptors.response.use((response) => {
|
|
|
return Promise.reject(response)
|
|
|
}, (error) => {
|
|
|
Message({
|
|
|
- message: `请求失败:${error.errMsg}`,
|
|
|
+ message: `请求失败:${error.statusText}`,
|
|
|
type: 'error',
|
|
|
duration: 5 * 1000
|
|
|
})
|