Skip to content

Commit 554a5d5

Browse files
committed
feat: 更新字典数据获取接口,支持传入字典编码参数
1 parent 7dd13a0 commit 554a5d5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/api/system/dict.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ const DictAPI = {
7575
* @param dictCode 字典编码
7676
* @returns 字典数据项
7777
*/
78-
getOptions() {
78+
getOptions(codes: string) {
7979
return request<any, DictVO[]>({
8080
url: `${DICT_BASE_URL}/options`,
8181
method: "get",
82+
params: { codes: codes },
8283
});
8384
},
8485
};

src/store/modules/dict.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const useDictStore = defineStore("dict", () => {
99
};
1010

1111
const loadDictionaries = async () => {
12-
const dictList = await DictionaryAPI.getOptions();
12+
const dictList = await DictionaryAPI.getOptions("all");
1313
dictList.forEach(setDictionary);
1414
};
1515

0 commit comments

Comments
 (0)