From 1038f167838bd9f0272bb6660b28cc685b035163 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 7 Mar 2023 21:05:23 +0800 Subject: [PATCH] perf: export `addPathMatch` utils --- src/router/index.ts | 3 ++- src/router/utils.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 7b54a7f..37a42e6 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 d2a7898..7e6aa5a 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -367,6 +367,7 @@ export { ascending, filterTree, initRouter, + addPathMatch, isOneOfArray, getHistoryMode, addAsyncRoutes,