BUG
parent
2438f65d9e
commit
d1cfe78283
|
@ -21,10 +21,16 @@ const request = (option: any) => {
|
||||||
export default {
|
export default {
|
||||||
get: async <T = any>(option: any) => {
|
get: async <T = any>(option: any) => {
|
||||||
const res = await request({ method: 'GET', ...option })
|
const res = await request({ method: 'GET', ...option })
|
||||||
return res.data as unknown as T
|
if (res == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return res.data as unknown as T;
|
||||||
},
|
},
|
||||||
post: async <T = any>(option: any) => {
|
post: async <T = any>(option: any) => {
|
||||||
const res = await request({ method: 'POST', ...option })
|
const res = await request({ method: 'POST', ...option })
|
||||||
|
if (res == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return res.data as unknown as T
|
return res.data as unknown as T
|
||||||
},
|
},
|
||||||
postOriginal: async (option: any) => {
|
postOriginal: async (option: any) => {
|
||||||
|
@ -33,10 +39,16 @@ export default {
|
||||||
},
|
},
|
||||||
delete: async <T = any>(option: any) => {
|
delete: async <T = any>(option: any) => {
|
||||||
const res = await request({ method: 'DELETE', ...option })
|
const res = await request({ method: 'DELETE', ...option })
|
||||||
|
if (res == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return res.data as unknown as T
|
return res.data as unknown as T
|
||||||
},
|
},
|
||||||
put: async <T = any>(option: any) => {
|
put: async <T = any>(option: any) => {
|
||||||
const res = await request({ method: 'PUT', ...option })
|
const res = await request({ method: 'PUT', ...option })
|
||||||
|
if (res == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return res.data as unknown as T
|
return res.data as unknown as T
|
||||||
},
|
},
|
||||||
download: async <T = any>(option: any) => {
|
download: async <T = any>(option: any) => {
|
||||||
|
|
|
@ -46,21 +46,23 @@ export const useDictStore = defineStore('dict', {
|
||||||
} else {
|
} else {
|
||||||
const res = await listSimpleDictDataApi()
|
const res = await listSimpleDictDataApi()
|
||||||
// 设置数据
|
// 设置数据
|
||||||
const dictDataMap = new Map<string, any>()
|
const dictDataMap = new Map<string, any>();
|
||||||
res.forEach((dictData: DictDataVO) => {
|
if (res != null) {
|
||||||
// 获得 dictType 层级
|
res.forEach((dictData: DictDataVO) => {
|
||||||
const enumValueObj = dictDataMap[dictData.dictType]
|
// 获得 dictType 层级
|
||||||
if (!enumValueObj) {
|
const enumValueObj = dictDataMap[dictData.dictType]
|
||||||
dictDataMap[dictData.dictType] = []
|
if (!enumValueObj) {
|
||||||
}
|
dictDataMap[dictData.dictType] = []
|
||||||
// 处理 dictValue 层级
|
}
|
||||||
dictDataMap[dictData.dictType].push({
|
// 处理 dictValue 层级
|
||||||
value: dictData.value,
|
dictDataMap[dictData.dictType].push({
|
||||||
label: dictData.label,
|
value: dictData.value,
|
||||||
colorType: dictData.colorType,
|
label: dictData.label,
|
||||||
cssClass: dictData.cssClass
|
colorType: dictData.colorType,
|
||||||
})
|
cssClass: dictData.cssClass
|
||||||
})
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
this.dictMap = dictDataMap
|
this.dictMap = dictDataMap
|
||||||
this.isSetDict = true
|
this.isSetDict = true
|
||||||
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
wsCache.set(CACHE_KEY.DICT_CACHE, dictDataMap, { exp: 60 }) // 60 秒 过期
|
||||||
|
|
|
@ -277,7 +277,9 @@ const handleLogin = async (params) => {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loginLoading.value = false
|
loginLoading.value = false
|
||||||
loading.value.close()
|
if (loading.value != null) {
|
||||||
|
loading.value.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue