소스 검색

修改 base路由

dengrui 3 달 전
부모
커밋
10c858535d
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      src/plugins/permission.ts

+ 12 - 1
src/plugins/permission.ts

@@ -51,7 +51,18 @@ export function setupPermission() {
                 router.addRoute(route);
               });
 
-              next({ path: to.fullPath });
+              // if (to.fullPath.split("/")[1] == "base") {
+              //   console.log(to.fullPath.split("/")[1]);
+              //   (
+              //     "/base/craftManagement/defectMana"
+              //   );
+              // }
+              next({
+                path:
+                  to.fullPath.split("/")[1] == "base"
+                    ? "/base/craftManagement/defectMana"
+                    : to.fullPath,
+              });
             } catch (error) {
               console.error("beforeEach error", error);
               // 移除 token 并跳转登录页