Shannon_mu 2 年之前
父节点
当前提交
16c2841e87
共有 1 个文件被更改,包括 33 次插入27 次删除
  1. 33 27
      operationSupport/src/utils/http.js

+ 33 - 27
operationSupport/src/utils/http.js

@@ -57,33 +57,39 @@ http.interceptors.response.use(
                 window.relogin = true;
                 let data = response.data.data;
                 if (data == 0) {
-                    Vue.prototype
-                        .$msgBox('你的登录已超时,请重新登录', '', 'warning', {
-                            width: '290px',
-                            showCancelButton: false,
-                            confirmButtonText: '确定',
-                            showClose: false
-                        })
-                        .then(() => {
-                            window.open(config.loginUrl, '_self');
-                            window.relogin = false;
-                            localStorage.removeItem('SC_token');
-                        })
-                        .catch(() => {});
+                    // Vue.prototype
+                    //     .$msgBox('你的登录已超时,请重新登录', '', 'warning', {
+                    //         width: '290px',
+                    //         showCancelButton: false,
+                    //         confirmButtonText: '确定',
+                    //         showClose: false
+                    //     })
+                    //     .then(() => {
+                    //         window.open(config.loginUrl, '_self');
+                    //         window.relogin = false;
+                    //         localStorage.removeItem('SC_token');
+                    //     })
+                    //     .catch(() => { });
+                    ELEMENT.Message.success('你的登录已超时,请重新登录');
+                    window.open(config.loginUrl, '_self');
+                    window.relogin = false;
+                    localStorage.removeItem('SC_token');
                 } else if (data == 1) {
                     Vue.prototype
-                        .$msgBox('该账号已在其他地址登录,如需访问请重新登录', '', 'warning', {
-                            width: '290px',
-                            showCancelButton: false,
-                            confirmButtonText: '确定',
-                            showClose: false
-                        })
-                        .then(() => {
-                            window.open(config.loginUrl, '_self');
-                            window.relogin = false;
-                            localStorage.removeItem('SC_token');
-                        })
-                        .catch(() => {});
+                    // .$msgBox('该账号已在其他地址登录,如需访问请重新登录', '', 'warning', {
+                    //     width: '290px',
+                    //     showCancelButton: false,
+                    //     confirmButtonText: '确定',
+                    //     showClose: false
+                    // })
+                    // .then(() => {
+
+                    // })
+                    // .catch(() => {});
+                    ELEMENT.Message.success('您已退出登录');
+                    window.open(config.loginUrl, '_self');
+                    window.relogin = false;
+                    localStorage.removeItem('SC_token');
                 } else {
                     Vue.prototype
                         .$msgBox('你的账号已被停用,如有问题请联系管理员', '', 'warning', {
@@ -97,12 +103,12 @@ http.interceptors.response.use(
                             window.relogin = false;
                             localStorage.removeItem('SC_token');
                         })
-                        .catch(() => {});
+                        .catch(() => { });
                 }
             });
             return;
         }
-        if (axios.isCancel(err)) return new Promise(() => {}); // 取消请求的情况下,终端Promise调用链
+        if (axios.isCancel(err)) return new Promise(() => { }); // 取消请求的情况下,终端Promise调用链
         return Promise.reject(err);
     }
 );