This commit is contained in:
2025-08-09 09:54:23 +08:00
parent 6ef758653e
commit 8ce6d2877c
4 changed files with 242 additions and 5 deletions

View File

@ -13,12 +13,16 @@ NProgress.configure({ showSpinner: false });
const whiteList = ['/login', '/register', '/social-callback', '/register*', '/register/*'];
const isWhiteList = (path: string) => {
return whiteList.some(pattern => isPathMatch(pattern, path))
}
return whiteList.some((pattern) => isPathMatch(pattern, path));
};
router.beforeEach(async (to, from, next) => {
NProgress.start();
if (getToken()) {
console.log(to);
console.log(getToken());
if (to.path == '/indexEquipment') {
next();
} else if (getToken()) {
to.meta.title && useSettingsStore().setTitle(to.meta.title);
/* has token*/
if (to.path === '/login') {