|
@@ -19,10 +19,12 @@ const isWhiteList = (path: string) => {
|
|
|
|
|
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
NProgress.start();
|
|
NProgress.start();
|
|
|
|
|
+/*
|
|
|
console.log('当前访问路径:', to.path);
|
|
console.log('当前访问路径:', to.path);
|
|
|
console.log('是否在白名单:', isWhiteList(to.path));
|
|
console.log('是否在白名单:', isWhiteList(to.path));
|
|
|
console.log('是否有 token:', getToken());
|
|
console.log('是否有 token:', getToken());
|
|
|
console.log('用户角色数量:', useUserStore().roles.length); // 打印角色数量
|
|
console.log('用户角色数量:', useUserStore().roles.length); // 打印角色数量
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
if (getToken()) {
|
|
if (getToken()) {
|
|
|
to.meta.title && useSettingsStore().setTitle(to.meta.title as string);
|
|
to.meta.title && useSettingsStore().setTitle(to.meta.title as string);
|