浏览代码

2024.09.11 补充提交

zweiqin 6 月之前
父节点
当前提交
fb83303d1f
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/utils/aTFRequest.js

+ 3 - 3
src/utils/aTFRequest.js

@@ -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
   })