fix(projects): 修复路由守卫的动态路由逻辑
This commit is contained in:
parent
20911dd882
commit
e6c26fcb4a
3
components.d.ts
vendored
3
components.d.ts
vendored
@ -16,6 +16,9 @@ declare module 'vue' {
|
||||
IconCustomAvatar: typeof import('~icons/custom/avatar')['default']
|
||||
IconCustomLogo: typeof import('~icons/custom/logo')['default']
|
||||
IconCustomLogoFill: typeof import('~icons/custom/logo-fill')['default']
|
||||
IconCustomNoPermission: typeof import('~icons/custom/no-permission')['default']
|
||||
IconCustomNotFound: typeof import('~icons/custom/not-found')['default']
|
||||
IconCustomServiceError: typeof import('~icons/custom/service-error')['default']
|
||||
IconGridiconsFullscreen: typeof import('~icons/gridicons/fullscreen')['default']
|
||||
IconGridiconsFullscreenExit: typeof import('~icons/gridicons/fullscreen-exit')['default']
|
||||
IconIcOutlineCheck: typeof import('~icons/ic/outline-check')['default']
|
||||
|
@ -35,11 +35,12 @@ export async function createDynamicRouteGuard(
|
||||
next({ path: to.fullPath, replace: true, query: to.query });
|
||||
return false;
|
||||
}
|
||||
// 动态路由已经加载,仍然未找到,重定向到not-found
|
||||
if (to.name === routeName('not-found-page')) {
|
||||
next({ name: routeName('not-found'), replace: true });
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 动态路由已经加载,仍然未找到,重定向到not-found
|
||||
if (to.name === routeName('not-found-page')) {
|
||||
next({ name: routeName('not-found'), replace: true });
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -28,6 +28,9 @@ export default function subscribeThemeStore() {
|
||||
} else {
|
||||
removeDarkClass();
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user