mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-27 06:41:12 +00:00
feat(api): 修改导出接口返回类型为Blob并统一处理导出逻辑 feat(router): 添加404路由匹配规则 fix(permission): 优化动态路由处理逻辑 feat(login): 登录成功后自动显示项目引导 feat(navbar): 优化用户头像显示和引导可见性控制 feat(store): 添加引导可见性状态管理 refactor(views): 统一导出功能实现方式 fix(backend): 添加导出数据中的创建者字段 refactor(user): 优化用户导入导出功能 refactor(job): 重构定时任务页面和导出逻辑
104 lines
2.1 KiB
TypeScript
104 lines
2.1 KiB
TypeScript
import request from "@/utils/request";
|
|
|
|
const ConfigAPI = {
|
|
uploadFile(body: any) {
|
|
return request<ApiResponse<UploadFilePath>>({
|
|
url: `/system/config/upload`,
|
|
method: "post",
|
|
data: body,
|
|
headers: { "Content-Type": "multipart/form-data" },
|
|
});
|
|
},
|
|
|
|
getInitConfig() {
|
|
return request<ApiResponse<ConfigTable[]>>({
|
|
url: `/system/config/info`,
|
|
method: "get",
|
|
});
|
|
},
|
|
|
|
getConfigList(query: ConfigPageQuery) {
|
|
return request<ApiResponse<PageResult<ConfigTable[]>>>({
|
|
url: `/system/config/list`,
|
|
method: "get",
|
|
params: query,
|
|
});
|
|
},
|
|
|
|
getConfigDetail(query: number) {
|
|
return request<ApiResponse<ConfigTable>>({
|
|
url: `/system/config/detail/${query}`,
|
|
method: "get",
|
|
});
|
|
},
|
|
|
|
createConfig(body: ConfigForm) {
|
|
return request<ApiResponse>({
|
|
url: `/system/config/create`,
|
|
method: "post",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
updateConfig(body: ConfigForm) {
|
|
return request<ApiResponse>({
|
|
url: `/system/config/update`,
|
|
method: "put",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
deleteConfig(body: number[]) {
|
|
return request<ApiResponse>({
|
|
url: `/system/config/delete`,
|
|
method: "delete",
|
|
data: body,
|
|
});
|
|
},
|
|
|
|
exportConfig(body: ConfigPageQuery) {
|
|
return request<Blob>({
|
|
url: `/system/config/export`,
|
|
method: "post",
|
|
data: body,
|
|
responseType: "blob",
|
|
});
|
|
},
|
|
};
|
|
|
|
export default ConfigAPI;
|
|
|
|
export interface ConfigPageQuery extends PageQuery {
|
|
/** 配置名称 */
|
|
config_name?: string;
|
|
/** 配置键 */
|
|
config_key?: string;
|
|
/** 配置类型 */
|
|
config_type?: boolean;
|
|
/** 开始时间 */
|
|
start_time?: string;
|
|
/** 结束时间 */
|
|
end_time?: string;
|
|
}
|
|
|
|
export interface ConfigTable {
|
|
id?: number;
|
|
config_name?: string;
|
|
config_key?: string;
|
|
config_value?: string;
|
|
config_type?: boolean;
|
|
description?: string;
|
|
created_at?: string;
|
|
updated_at?: string;
|
|
creator?: creatorType;
|
|
}
|
|
|
|
export interface ConfigForm {
|
|
id?: number;
|
|
config_name?: string;
|
|
config_key?: string;
|
|
config_value?: string;
|
|
config_type?: boolean;
|
|
description?: string;
|
|
}
|