Browse Source

tool(request):工具

sufan 6 months ago
parent
commit
d40a990291
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/utils/request.js

+ 4 - 2
src/utils/request.js

@@ -85,8 +85,9 @@ service.interceptors.response.use(
         return response
       }
       if (res.code !== 200) {
+        // '后端异常:' +
         Message({
-          message: '后端异常:' + res.message || 'Error',
+          message: res.message || 'Error',
           type: 'error',
           duration: 5 * 1000
         })
@@ -103,8 +104,9 @@ service.interceptors.response.use(
     loadingInstance && loadingInstance.close()
     const { message } = error.response.data
     console.log('err' + error) // for debug
+    // '后端异常:' +
     Message({
-      message: '后端异常:' + message,
+      message: message,
       type: 'error',
       duration: 5 * 1000
     })