Browse Source

perf: export `addPathMatch` utils

i18n
xiaoxian521 2 years ago
parent
commit
1038f16783
  1. 3
      src/router/index.ts
  2. 1
      src/router/utils.ts

3
src/router/index.ts

@ -139,7 +139,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
if ( if (
usePermissionStoreHook().wholeMenus.length === 0 && usePermissionStoreHook().wholeMenus.length === 0 &&
to.path !== "/login" to.path !== "/login"
)
) {
initRouter().then((router: Router) => { initRouter().then((router: Router) => {
if (!useMultiTagsStoreHook().getMultiTagsCache) { if (!useMultiTagsStoreHook().getMultiTagsCache) {
const { path } = to; const { path } = to;
@ -158,6 +158,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
} }
router.push(to.fullPath); router.push(to.fullPath);
}); });
}
toCorrectRoute(); toCorrectRoute();
} }
} else { } else {

1
src/router/utils.ts

@ -367,6 +367,7 @@ export {
ascending, ascending,
filterTree, filterTree,
initRouter, initRouter,
addPathMatch,
isOneOfArray, isOneOfArray,
getHistoryMode, getHistoryMode,
addAsyncRoutes, addAsyncRoutes,

Loading…
Cancel
Save