系统动态设置.

This commit is contained in:
lijiahang
2024-10-10 18:32:40 +08:00
parent 76aa64fe75
commit c229029c1d
27 changed files with 751 additions and 44 deletions

View File

@@ -1,5 +1,20 @@
import axios from 'axios';
/**
* 系统配置类型
*/
export type SystemSettingType = 'SFTP';
/**
* 系统设置更新请求
*/
export interface SystemSettingUpdateRequest {
type?: SystemSettingType;
item?: string;
value?: any;
settings?: Record<string, any>;
}
/**
* 应用信息查询响应
*/
@@ -31,10 +46,10 @@ export interface AppReleaseResponse {
}
/**
* 查询 license 信息
* SFTP 配置
*/
export function getSystemLicenseInfo() {
return axios.get<SystemLicenseResponse>('/infra/system-setting/license');
export interface SftpSetting {
previewSize: number;
}
/**
@@ -57,3 +72,24 @@ export function getAppLatestRelease() {
promptRequestErrorMessage: false,
});
}
/**
* 更新系统设置
*/
export function updateSystemSetting(request: SystemSettingUpdateRequest) {
return axios.put<number>('/infra/system-setting/update', request);
}
/**
* 更新部分系统设置
*/
export function updatePartialSystemSetting(request: SystemSettingUpdateRequest) {
return axios.put<number>('/infra/system-setting/update-partial', request);
}
/**
* 查询系统设置
*/
export function getSystemSetting<T>(type: SystemSettingType) {
return axios.get<T>('/infra/system-setting/setting', { params: { type } });
}