From 13a7262172d3e48cb26989b7dfa5b453664f5dde Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 12 Mar 2025 22:12:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E5=85=B8=E5=92=8C=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在字典管理页面添加清除缓存按钮,用于清除单个字典的缓存 - 在菜单管理页面添加清除缓存按钮,用于清除全部菜单缓存 - 新增清除字典缓存和菜单缓存的 API 接口 - 优化字典树组件,增加选中字典的信息传递 --- src/apis/system/dict.ts | 5 ++++ src/apis/system/menu.ts | 5 ++++ src/views/system/dict/index.vue | 37 ++++++++++++++++++++------ src/views/system/dict/tree/index.vue | 18 ++++++++----- src/views/system/menu/index.vue | 39 +++++++++++++++++++++------- 5 files changed, 81 insertions(+), 23 deletions(-) diff --git a/src/apis/system/dict.ts b/src/apis/system/dict.ts index 3960ac2..08e418e 100644 --- a/src/apis/system/dict.ts +++ b/src/apis/system/dict.ts @@ -30,6 +30,11 @@ export function deleteDict(id: string) { return http.del(`${BASE_URL}/${id}`) } +/** @desc 清除字典缓存 */ +export function clearDictCache(code: string) { + return http.del(`${BASE_URL}/cache/${code}`) +} + /** @desc 查询字典项列表 */ export function listDictItem(query: T.DictItemPageQuery) { return http.get>(`${BASE_URL}/item`, query) diff --git a/src/apis/system/menu.ts b/src/apis/system/menu.ts index 5702f6c..c5a0b09 100644 --- a/src/apis/system/menu.ts +++ b/src/apis/system/menu.ts @@ -29,3 +29,8 @@ export function updateMenu(data: any, id: string) { export function deleteMenu(id: string) { return http.del(`${BASE_URL}/${id}`) } + +/** @desc 清除菜单缓存 */ +export function clearMenuCache() { + return http.del(`${BASE_URL}/cache`) +} diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 42a1de3..ec3139f 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -1,10 +1,5 @@