Browse Source

菜单管理缓存问题

master
zhangli 1 year ago
parent
commit
0dcda79582
  1. 4
      src/views/system/menu/index.vue

4
src/views/system/menu/index.vue

@ -84,6 +84,7 @@ 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'
import { getInfo } from '@/api/login'
defineOptions({ name: 'SystemMenu' }) defineOptions({ name: 'SystemMenu' })
@ -107,6 +108,9 @@ const getList = async () => {
try { try {
const data = await MenuApi.getMenuList(queryParams) const data = await MenuApi.getMenuList(queryParams)
list.value = handleTree(data) list.value = handleTree(data)
let userInfo = await getInfo()
wsCache.set(CACHE_KEY.USER, userInfo)
wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
} finally { } finally {
loading.value = false loading.value = false
} }

Loading…
Cancel
Save