diff --git a/src/router/index.ts b/src/router/index.ts index 1650832a5..a0c8f484b 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -139,7 +139,7 @@ router.beforeEach((to: toRouteType, _from, next) => { if ( usePermissionStoreHook().wholeMenus.length === 0 && to.path !== "/login" - ) + ) { initRouter().then((router: Router) => { if (!useMultiTagsStoreHook().getMultiTagsCache) { const { path } = to; @@ -158,6 +158,7 @@ router.beforeEach((to: toRouteType, _from, next) => { } router.push(to.fullPath); }); + } toCorrectRoute(); } } else { diff --git a/src/router/utils.ts b/src/router/utils.ts index d2a789803..7e6aa5a1b 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -367,6 +367,7 @@ export { ascending, filterTree, initRouter, + addPathMatch, isOneOfArray, getHistoryMode, addAsyncRoutes,