菜单管理:添加刷新菜单缓存按钮

This commit is contained in:
YunaiV 2023-04-22 20:44:32 +08:00
parent 9f35ea9e82
commit f27b93db59

View File

@ -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 {