mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-16 07:10:34 +08:00
feat: 完善参数页面的开发
This commit is contained in:
76
src/api/system/config.ts
Normal file
76
src/api/system/config.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
export interface ConfigQuery extends BasePageQuery {
|
||||
/**
|
||||
* 配置key
|
||||
*/
|
||||
configKey?: string;
|
||||
/**
|
||||
* 配置名称
|
||||
*/
|
||||
configName?: string;
|
||||
/**
|
||||
* 是否允许更改配置
|
||||
*/
|
||||
isAllowChange?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ConfigDTO, 配置信息
|
||||
*/
|
||||
export interface ConfigDTO {
|
||||
configId?: string;
|
||||
configKey?: string;
|
||||
configName?: string;
|
||||
configOptions?: string[];
|
||||
configValue?: string;
|
||||
createTime?: Date;
|
||||
isAllowChange?: string;
|
||||
isAllowChangeStr?: string;
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* ConfigUpdateCommand
|
||||
*/
|
||||
export interface UpdateConfigRequest {
|
||||
configValue: string;
|
||||
}
|
||||
|
||||
/** 获取配置列表 */
|
||||
export const getConfigListApi = (params?: ConfigQuery) => {
|
||||
return http.request<ResponseData<PageDTO<ConfigDTO>>>(
|
||||
"get",
|
||||
"/system/configs",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/** 获取配置信息 */
|
||||
export const getConfigInfoApi = (configId: string) => {
|
||||
return http.request<ResponseData<ConfigDTO>>(
|
||||
"get",
|
||||
`/system/config/${configId}`
|
||||
);
|
||||
};
|
||||
|
||||
/** 刷新配置缓存 */
|
||||
export const updateConfigApi = (
|
||||
configId: number,
|
||||
data: UpdateConfigRequest
|
||||
) => {
|
||||
return http.request<ResponseData<PageDTO<ConfigDTO>>>(
|
||||
"put",
|
||||
`/system/config/${configId}`,
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
/** 刷新配置缓存 */
|
||||
export const refreshConfigCacheApi = () => {
|
||||
return http.request<ResponseData<void>>("delete", "/system/configs/cache");
|
||||
};
|
||||
Reference in New Issue
Block a user