File size: 865 Bytes
dc649b1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import { requestClient } from '#/api/request';
// ======================== 类型定义 ========================
export interface SystemConfig {
sync_cron_hour: number;
sync_max_concurrent: number;
access_token_expire_minutes: number;
}
export interface SystemConfigUpdateParams {
/** 每日自动同步时间(0~23 小时) */
sync_cron_hour?: number;
/** access token 有效期(分钟,1~43200) */
access_token_expire_minutes?: number;
}
// ======================== API ========================
/** 获取系统配置 GET /admin/system/config */
export function getSystemConfigApi() {
return requestClient.get<SystemConfig>('/admin/system/config');
}
/** 更新系统配置 PUT /admin/system/config */
export function updateSystemConfigApi(data: SystemConfigUpdateParams) {
return requestClient.put('/admin/system/config', data);
}
|