瀏覽代碼

登录失效

seimin 2 年之前
父節點
當前提交
1376ca40bf
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 8 1
      src/main.js
  2. 1 1
      src/router/index.js

+ 8 - 1
src/main.js

@@ -18,7 +18,14 @@ axios.defaults.baseURL = protocolName + "//" + domainName;
18 18
 // axios.defaults.baseURL = http.host;
19 19
 // axios.defaults.timeout = 5000;
20 20
 axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8";
21
-
21
+axios.interceptors.response.use(function (response) {
22
+  return response;
23
+}, function (error) {
24
+  if(error && error.response && error.response.status == 444){
25
+    window.location.href = location.origin + '/service.jsp';
26
+  }
27
+  return Promise.reject(error);
28
+});
22 29
 Vue.prototype.$http = axios;
23 30
 Vue.config.productionTip = false;
24 31
 // http request拦截器 添加一个请求拦截器

+ 1 - 1
src/router/index.js

@@ -159,7 +159,7 @@ const router = new Router({
159 159
       path: "*",
160 160
       hidden: true,
161 161
       redirect: {
162
-        path: "/login"
162
+        path: "/"
163 163
       }
164 164
     }
165 165
   ]