diff --git a/src/store/modules/dict.ts b/src/store/modules/dict.ts index e239fb008..ee7f285ad 100644 --- a/src/store/modules/dict.ts +++ b/src/store/modules/dict.ts @@ -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() 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() res.forEach((dictData: DictDataVO) => {