refactor: dict

This commit is contained in:
xingyu
2022-11-16 23:15:14 +08:00
parent 7c0c123b9a
commit 7455348a6e
39 changed files with 155 additions and 54 deletions

View File

@ -12,6 +12,9 @@ import { useUserStoreWithOut } from '@/store/modules/user'
import { listSimpleDictDataApi } from '@/api/system/dict/dict.data'
import { isRelogin } from '@/config/axios/service'
import { getInfoApi } from '@/api/login'
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
const { start, done } = useNProgress()
@ -47,7 +50,8 @@ router.beforeEach(async (to, from, next) => {
const dictStore = useDictStoreWithOut()
const userStore = useUserStoreWithOut()
const permissionStore = usePermissionStoreWithOut()
if (!dictStore.getHasDictData) {
const dictMap = wsCache.get('dictCache')
if (!dictMap) {
const res = await listSimpleDictDataApi()
dictStore.setDictMap(res)
}