|
@@ -7,7 +7,7 @@ import NProgress from "@/utils/nprogress";
|
|
|
|
|
|
export function setupPermission() {
|
|
export function setupPermission() {
|
|
// 白名单路由
|
|
// 白名单路由
|
|
- const whiteList = ["/login", "/demo/hooks"];
|
|
|
|
|
|
+ const whiteList = [""];
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
router.beforeEach(async (to, from, next) => {
|
|
NProgress.start();
|
|
NProgress.start();
|
|
@@ -54,9 +54,15 @@ export function setupPermission() {
|
|
} else {
|
|
} else {
|
|
// 未登录可以访问白名单页面
|
|
// 未登录可以访问白名单页面
|
|
if (whiteList.indexOf(to.path) !== -1) {
|
|
if (whiteList.indexOf(to.path) !== -1) {
|
|
|
|
+ const dictStore = useDictionaryStore();
|
|
|
|
+ dictStore.checkDicts();
|
|
next();
|
|
next();
|
|
} else {
|
|
} else {
|
|
- next(`/login?redirect=${to.path}`);
|
|
|
|
|
|
+ if (to.path === "/login") {
|
|
|
|
+ next();
|
|
|
|
+ } else {
|
|
|
|
+ next(`/login`);
|
|
|
|
+ }
|
|
NProgress.done();
|
|
NProgress.done();
|
|
}
|
|
}
|
|
}
|
|
}
|