refactor: 分离终端配置.

This commit is contained in:
lijiahangmax
2024-01-11 00:43:18 +08:00
parent b5cdd0b362
commit 7f9a97180e
21 changed files with 225 additions and 423 deletions

View File

@@ -1,4 +1,5 @@
import axios from 'axios';
import qs from 'query-string';
type PreferenceType = 'SYSTEM' | 'TERMINAL'
@@ -36,7 +37,15 @@ export function updatePreferencePartial(request: PreferenceUpdatePartialRequest)
/**
* 查询用户偏好
*/
export function getPreference<T>(type: PreferenceType) {
return axios.get<T>('/infra/preference/get', { params: { type } });
export function getPreference<T>(type: PreferenceType, items: Array<string> | undefined = undefined) {
return axios.get<T>('/infra/preference/get', {
params: {
type,
items
},
paramsSerializer: params => {
return qs.stringify(params, { arrayFormat: 'comma' });
}
});
}