fix: router refresh (#136)

This commit is contained in:
一万 2021-11-30 21:42:30 +08:00 committed by GitHub
parent 0450f004d3
commit d04ba7563a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -234,7 +234,13 @@ router.beforeEach((to, _from, next) => {
if (usePermissionStoreHook().wholeRoutes.length === 0) if (usePermissionStoreHook().wholeRoutes.length === 0)
initRouter(name.username).then((router: Router) => { initRouter(name.username).then((router: Router) => {
if (!useMultiTagsStoreHook().getMultiTagsCache) { if (!useMultiTagsStoreHook().getMultiTagsCache) {
return router.push("/"); useMultiTagsStoreHook().handleTags("push", {
path: to.path,
parentPath: to.matched[0]?.path,
name: to.name,
meta: to.meta
});
return router.push(to.path);
} }
router.push(to.path); router.push(to.path);
// 刷新页面更新标签栏与页面路由匹配 // 刷新页面更新标签栏与页面路由匹配