vbea 2 年之前
父節點
當前提交
ada8670b03
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      Strides-Admin/src/http/http.js

+ 5 - 3
Strides-Admin/src/http/http.js

@@ -41,9 +41,11 @@ axios.interceptors.response.use(res => {
     if (res.data.code == "402") { //Token过期,需要登录
       const path = router.currentRoute.fullPath
       //console.log('lougout+path', path);
-      store.dispatch("user/logout").then(res => {
-        router.push({ path: "/login?redirect=" + path});
-      })
+      if (path.indexOf('/login') == -1) {
+        store.dispatch("user/logout").then(res => {
+          router.push({ path: "/login?redirect=" + path});
+        })
+      }
     }
     if (res.data.msg) {
       return Promise.reject(res.data.msg)