From 29144aba442a7e620609de586a3fccdf7406bb49 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 24 Aug 2022 16:11:41 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=87=8D=E7=BD=AE=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=B8=85=E7=A9=BA=E7=BC=93=E5=AD=98=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/tag/index.vue | 2 -- src/router/index.ts | 1 + src/store/modules/permission.ts | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layout/components/tag/index.vue b/src/layout/components/tag/index.vue index c69b046..a621e61 100644 --- a/src/layout/components/tag/index.vue +++ b/src/layout/components/tag/index.vue @@ -9,7 +9,6 @@ import { useResizeObserver, useDebounceFn } from "@vueuse/core"; import { useSettingStoreHook } from "/@/store/modules/settings"; import { handleAliveRoute, delAliveRoutes } from "/@/router/utils"; import { useMultiTagsStoreHook } from "/@/store/modules/multiTags"; -import { usePermissionStoreHook } from "/@/store/modules/permission"; import { ref, watch, unref, toRaw, nextTick, onBeforeMount } from "vue"; const { @@ -276,7 +275,6 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) { startIndex: 1, length: multiTags.value.length }); - usePermissionStoreHook().clearAllCachePage(); router.push("/welcome"); break; } diff --git a/src/router/index.ts b/src/router/index.ts index 3afb750..a260b1e 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -81,6 +81,7 @@ export function resetRouter() { ); } }); + usePermissionStoreHook().clearAllCachePage(); } // 路由白名单 diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index f2aa691..27c5dae 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -63,6 +63,9 @@ export const usePermissionStore = defineStore({ }, // 清空缓存页面 clearAllCachePage() { + this.wholeMenus = []; + this.menusTree = []; + this.buttonAuth = []; this.cachePageList = []; } }