Browse Source

登陆成功之后才获取字典

hella_online_20240829
wangyufei 4 months ago
parent
commit
bf66dda27a
  1. 4
      src/store/modules/dict.ts

4
src/store/modules/dict.ts

@ -5,6 +5,7 @@ import { DictDataVO } from '@/api/system/dict/types'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache('sessionStorage')
import { listSimpleDictData } from '@/api/system/dict/dict.data'
import { getAccessToken } from '@/utils/auth'
export interface DictValueType {
value: any
@ -45,6 +46,9 @@ export const useDictStore = defineStore('dict', {
this.dictMap = dictMap
this.isSetDict = true
} else {
if(!getAccessToken()){
return
}
const res = await listSimpleDictData()
// 设置数据
const dictDataMap = new Map<string, any>()

Loading…
Cancel
Save