|
@@ -7,11 +7,13 @@ import NProgress from "@/utils/nprogress";
|
|
|
import { getUserDicts } from "@/api/auth";
|
|
|
import { ElStep } from "element-plus";
|
|
|
|
|
|
-export function setupPermission(path: string) {
|
|
|
+export function setupPermission() {
|
|
|
// 白名单路由
|
|
|
const whiteList = [""];
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
+ const path = to.fullPath.split("/")[1];
|
|
|
+ console.log(to.fullPath, path, "2222");
|
|
|
NProgress.start();
|
|
|
const hasToken = localStorage.getItem("token");
|
|
|
|
|
@@ -50,9 +52,7 @@ export function setupPermission(path: string) {
|
|
|
accessRoutes.forEach((route) => {
|
|
|
router.addRoute(route);
|
|
|
});
|
|
|
- console.log(router, path);
|
|
|
-
|
|
|
- next({ path: path });
|
|
|
+ next({ path: path ? path : "" });
|
|
|
} catch (error) {
|
|
|
console.error("beforeEach error", error);
|
|
|
// 移除 token 并跳转登录页
|