Skip to content

Commit f27b93d

Browse files
committed
菜单管理:添加刷新菜单缓存按钮
1 parent 9f35ea9 commit f27b93d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/views/system/menu/index.vue

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ import { handleTree } from '@/utils/tree'
129129
import * as MenuApi from '@/api/system/menu'
130130
import MenuForm from './MenuForm.vue'
131131
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
132-
133132
const { wsCache } = useCache()
134133
const { t } = useI18n() // 国际化
135134
const message = useMessage() // 消息弹窗
@@ -180,19 +179,18 @@ const toggleExpandAll = () => {
180179
refreshTable.value = true
181180
})
182181
}
182+
183183
/** 刷新菜单缓存按钮操作 */
184-
const refreshMenu = () => {
185-
ElMessageBox.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存', {
186-
confirmButtonText: t('common.ok'),
187-
cancelButtonText: t('common.cancel'),
188-
type: 'warning'
189-
}).then(() => {
184+
const refreshMenu = async () => {
185+
try {
186+
await message.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存')
190187
// 清空,从而触发刷新
191188
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
192189
// 刷新浏览器
193190
location.reload()
194-
})
191+
} catch {}
195192
}
193+
196194
/** 删除按钮操作 */
197195
const handleDelete = async (id: number) => {
198196
try {

0 commit comments

Comments
 (0)