瀏覽代碼

bug 修复

lilei 4 年之前
父節點
當前提交
5d85baac70
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/utils/request.js

+ 3 - 0
src/utils/request.js

@@ -15,6 +15,7 @@ const err = (error) => {
   if (error.response) {
     const data = error.response.data
     if ((error.response.status == 403 || error.response.status == 401) && window.location.pathname != '/user/login') {
+      notification.destroy()
       notification.error({
         message: '提示',
         description: data.message
@@ -28,6 +29,7 @@ const err = (error) => {
   }
   // 超时无法访问服务
   if (error.message.indexOf('timeout') >= 0 && window.location.pathname != '/user/login') {
+    notification.destroy()
     notification.error({
       message: '提示',
       description: error.message
@@ -54,6 +56,7 @@ service.interceptors.request.use(config => {
 service.interceptors.response.use((response) => {
   console.log(response, 'responseresponseresponse')
   if (response.data.status == '-1') {
+    notification.destroy()
     notification.error({
       message: '提示',
       description: response.data.message