fix: dict map

This commit is contained in:
xingyu
2023-01-17 15:13:23 +08:00
parent dbfc485bb1
commit 34f3e68558
3 changed files with 20 additions and 31 deletions

View File

@@ -66,6 +66,12 @@ export const useDictStore = defineStore('dict', {
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
}
},
getDictByType(type: string) {
if (!this.isSetDict) {
this.setDictMap()
}
return this.dictMap[type]
},
async resetDict() {
wsCache.delete(CACHE_KEY.DICT_CACHE)
const res = await listSimpleDictDataApi()