perf: 同步代码

Signed-off-by: xiaoxian521 <1923740402@qq.com>
This commit is contained in:
xiaoxian521
2021-11-10 22:19:28 +08:00
parent 8bfbfe5ab1
commit 425a6eb5c3
5 changed files with 35 additions and 18 deletions

View File

@@ -10,6 +10,7 @@ import { i18n } from "/@/plugins/i18n";
import { openLink } from "/@/utils/link";
import NProgress from "/@/utils/progress";
import { useTimeoutFn } from "@vueuse/core";
import { RouteConfigs } from "/@/layout/types";
import { storageSession, storageLocal } from "/@/utils/storage";
import { usePermissionStoreHook } from "/@/store/modules/permission";
@@ -61,6 +62,16 @@ export const getAliveRoute = () => {
return alivePageList;
};
// 批量删除缓存路由
export const delAliveRoutes = (delAliveRouteList: Array<RouteConfigs>) => {
delAliveRouteList.forEach(route => {
usePermissionStoreHook().cacheOperate({
mode: "delete",
name: route?.name
});
});
};
// 处理缓存路由(添加、删除、刷新)
export const handleAliveRoute = (
matched: RouteRecordNormalized[],