fix: 【dict.ts】handle empty response in dictionary data fetching,对应 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IDHHSM

pull/848/MERGE
YunaiV 2026-01-09 22:37:23 +08:00
parent 678f3c60cf
commit 457b8ab928
1 changed files with 6 additions and 0 deletions

View File

@ -46,6 +46,9 @@ export const useDictStore = defineStore('dict', {
this.isSetDict = true
} else {
const res = await getSimpleDictDataList()
if (!res || res.length === 0) {
return
}
// 设置数据
const dictDataMap = new Map<string, any>()
res.forEach((dictData: DictDataVO) => {
@ -76,6 +79,9 @@ export const useDictStore = defineStore('dict', {
async resetDict() {
wsCache.delete(CACHE_KEY.DICT_CACHE)
const res = await getSimpleDictDataList()
if (!res || res.length === 0) {
return
}
// 设置数据
const dictDataMap = new Map<string, any>()
res.forEach((dictData: DictDataVO) => {