fix: 【dict.ts】handle empty response in dictionary data fetching,对应 https://gitee.com/yudaocode/yudao-ui-admin-vue3/issues/IDHHSM
parent
678f3c60cf
commit
457b8ab928
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue