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