1
0
tangning 4 ماه پیش
والد
کامیت
8893790e9e
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      src/request/index.ts

+ 3 - 3
src/request/index.ts

@@ -54,8 +54,8 @@ axios.interceptors.request.use(async (config) => {
   if (!token && !~notLoginUrls.indexOf(config.url)) {
     // router.replace({ name: RouteName.login });
     let redirect = encodeURIComponent(`${window.location.href}`);
-    window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
-    throw "用户未登录";
+    // window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
+    // throw "用户未登录";
   }
   config.headers.token = token;
   config.headers['caseid'] = caseId;
@@ -122,7 +122,7 @@ const responseInterceptor = (res: AxiosResponse<any, any>) => {
       errMsg === "token已经失效,请重新登录"
     ) {
       let redirect = encodeURIComponent(`${window.location.href}`);
-      window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
+      // window.location.href = window.location.origin + "/admin/#/login?redirect=" + redirect;
       // router.replace({ name: RouteName.login });
       getAuth().clear();
     }