From 9c0872fa6a3d313272144eb45ec1a9354fe102c3 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Tue, 7 Mar 2023 21:02:36 +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 4cdc67b..9cf91c6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -137,7 +137,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; @@ -156,6 +156,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,