✨ 系统动态设置.
This commit is contained in:
@@ -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 } });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user