Browse Source

系统异常,显示code报错码

chenrui 3 years ago
parent
commit
62204a4e6c
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/utils/request.js

+ 8 - 1
src/utils/request.js

@@ -62,13 +62,20 @@ service.interceptors.response.use((response) => {
       }
     })
   }
-  if ((response.data.status == '401' || response.data.status == '900' || response.data.status == '500') && window.location.pathname != '/user/login') {
+  if ((response.data.status == '401' || response.data.status == '500') && window.location.pathname != '/user/login') {
     notification.destroy()
     notification.error({
       message: '提示',
       description: response.data.message
     })
   }
+  if (response.data.status == '900' && window.location.pathname != '/user/login') {
+    notification.destroy()
+    notification.error({
+      message: response.data.message,
+      description: response.data.code
+    })
+  }
   return response.data
 }, err)