浏览代码

系统异常,显示code报错码

chenrui 3 年之前
父节点
当前提交
62204a4e6c
共有 1 个文件被更改,包括 8 次插入1 次删除
  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)