From f27b93db5953d1ce499613f7151393412f668ebf Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 22 Apr 2023 20:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86=EF=BC=9A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B7=E6=96=B0=E8=8F=9C=E5=8D=95=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/menu/index.vue | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue index 95e71b5c..6be82506 100644 --- a/src/views/system/menu/index.vue +++ b/src/views/system/menu/index.vue @@ -129,7 +129,6 @@ import { handleTree } from '@/utils/tree' import * as MenuApi from '@/api/system/menu' import MenuForm from './MenuForm.vue' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' - const { wsCache } = useCache() const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -180,19 +179,18 @@ const toggleExpandAll = () => { refreshTable.value = true }) } + /** 刷新菜单缓存按钮操作 */ -const refreshMenu = () => { - ElMessageBox.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存', { - confirmButtonText: t('common.ok'), - cancelButtonText: t('common.cancel'), - type: 'warning' - }).then(() => { +const refreshMenu = async () => { + try { + await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存') // 清空,从而触发刷新 wsCache.delete(CACHE_KEY.ROLE_ROUTERS) // 刷新浏览器 location.reload() - }) + } catch {} } + /** 删除按钮操作 */ const handleDelete = async (id: number) => { try {