seimin 2 年 前
コミット
74593238b5
共有2 個のファイルを変更した9 個の追加1 個の削除を含む
  1. 8 0
      src/main.js
  2. 1 1
      src/router/index.js

+ 8 - 0
src/main.js

@@ -19,6 +19,14 @@ let protocolName = document.location.protocol; //http协议
19 19
 axios.defaults.baseURL = protocolName + "//" + domainName;
20 20
 
21 21
 // axios.defaults.timeout = 5000;
22
+axios.interceptors.response.use(function (response) {
23
+  return response;
24
+}, function (error) {
25
+  if(error && error.response && error.response.status == 444){
26
+    window.location.href = location.origin + ':8080/user.jsp';
27
+  }
28
+  return Promise.reject(error);
29
+});
22 30
 Vue.prototype.$http = axios;
23 31
 Vue.config.productionTip = false;
24 32
 Vue.prototype.$host = protocolName + "//" + domainName;

+ 1 - 1
src/router/index.js

@@ -236,7 +236,7 @@ export default new Router({
236 236
     path: '*',
237 237
     hidden: true,
238 238
     redirect: {
239
-      path: '/login'
239
+      path: '/'
240 240
     }
241 241
   }
242 242
   ]