diff --git a/src/layout/components/tag/index.vue b/src/layout/components/tag/index.vue index a792b50db..704adc6ce 100644 --- a/src/layout/components/tag/index.vue +++ b/src/layout/components/tag/index.vue @@ -169,6 +169,7 @@ function onFresh() { path: "/redirect" + fullPath, query }); + handleAliveRoute(route as toRouteType, "refresh"); } function deleteDynamicTag(obj: any, current: any, tag?: string) { diff --git a/src/router/utils.ts b/src/router/utils.ts index ed82c13ce..98c98f512 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -270,6 +270,12 @@ function handleAliveRoute({ name }: toRouteType, mode?: string) { name }); break; + case "refresh": + usePermissionStoreHook().cacheOperate({ + mode: "refresh", + name + }); + break; default: usePermissionStoreHook().cacheOperate({ mode: "delete", diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 8d8a85873..e357c9006 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -24,13 +24,15 @@ export const usePermissionStore = defineStore({ ); }, cacheOperate({ mode, name }: cacheType) { + const delIndex = this.cachePageList.findIndex(v => v === name); switch (mode) { + case "refresh": + this.cachePageList = this.cachePageList.filter(v => v !== name); + break; case "add": this.cachePageList.push(name); break; case "delete": - // eslint-disable-next-line no-case-declarations - const delIndex = this.cachePageList.findIndex(v => v === name); delIndex !== -1 && this.cachePageList.splice(delIndex, 1); break; }