mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-12-27 01:46:02 +08:00
v3.15.0【新增】升级SaToken到最新版本;【新增】重磅优化 数据字典;【新增】升级wangEditor-next;【新增】优化缓存实现redis与caffeine
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import { useDictStore } from '/@/store/modules/system/dict';
|
||||
import { dictApi } from '/@/api/support/dict-api';
|
||||
|
||||
/**
|
||||
* 获取字典数据
|
||||
*/
|
||||
|
||||
export function useDict(...args) {
|
||||
let res = {};
|
||||
args.forEach(async (keyCode, index) => {
|
||||
res[keyCode] = [];
|
||||
const dicts = useDictStore().getDict(keyCode);
|
||||
if (dicts) {
|
||||
res[keyCode] = dicts;
|
||||
} else {
|
||||
let result = await dictApi.valueList(keyCode);
|
||||
res[keyCode] = result.data;
|
||||
useDictStore().setDict(keyCode, res[keyCode]);
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
Reference in New Issue
Block a user