优化多个字典数据查询

This commit is contained in:
不做码农
2021-12-14 22:00:38 +08:00
parent f7edb87207
commit f5fbcb54d7
3 changed files with 14 additions and 16 deletions

View File

@@ -19,19 +19,18 @@ export function getData(dictCode) {
// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
return request({
url: '/system/dict/data/type/' + dictType,
method: 'get'
})
}
// 根据多个字典类型查询字典数据信息
export function getMoreDicts(dictType) {
return request({
url: '/system/dict/data/types',
data: dictType ,
method: 'post'
})
if (typeof (dictType) === "object") {
return request({
url: '/system/dict/data/types',
data: dictType,
method: 'post'
})
} else {
return request({
url: '/system/dict/data/type/' + dictType,
method: 'get'
})
}
}
// 新增字典数据