fix: update

This commit is contained in:
lrl
2021-11-27 15:16:50 +08:00
parent b65b972353
commit 6d3a8c5a88
4 changed files with 40 additions and 26 deletions

View File

@@ -12,6 +12,7 @@ import NProgress from "/@/utils/progress";
import { useTimeoutFn } from "@vueuse/core";
import { storageSession, storageLocal } from "/@/utils/storage";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
// 静态路由
import homeRouter from "./modules/home";
@@ -230,7 +231,9 @@ router.beforeEach((to, _from, next) => {
// 刷新
if (usePermissionStoreHook().wholeRoutes.length === 0)
initRouter(name.username).then((router: Router) => {
router.push(to.path);
useMultiTagsStoreHook().getMultiTagsCache
? router.push(to.path)
: router.push("/");
// 刷新页面更新标签栏与页面路由匹配
const localRoutes = storageLocal.getItem("responsive-tags");
const optionsRoutes = router.options?.routes;