菜单管理:添加刷新菜单缓存按钮
This commit is contained in:
parent
9f35ea9e82
commit
f27b93db59
@ -129,7 +129,6 @@ import { handleTree } from '@/utils/tree'
|
|||||||
import * as MenuApi from '@/api/system/menu'
|
import * as MenuApi from '@/api/system/menu'
|
||||||
import MenuForm from './MenuForm.vue'
|
import MenuForm from './MenuForm.vue'
|
||||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@ -180,19 +179,18 @@ const toggleExpandAll = () => {
|
|||||||
refreshTable.value = true
|
refreshTable.value = true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新菜单缓存按钮操作 */
|
/** 刷新菜单缓存按钮操作 */
|
||||||
const refreshMenu = () => {
|
const refreshMenu = async () => {
|
||||||
ElMessageBox.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存', {
|
try {
|
||||||
confirmButtonText: t('common.ok'),
|
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
|
||||||
cancelButtonText: t('common.cancel'),
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
// 清空,从而触发刷新
|
// 清空,从而触发刷新
|
||||||
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
|
||||||
// 刷新浏览器
|
// 刷新浏览器
|
||||||
location.reload()
|
location.reload()
|
||||||
})
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id: number) => {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user