Files
one-pipe-system/src/api/modules/systemConfig.ts
luo dd6bceeeb7
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled
feat: 系统配置
2026-07-25 14:13:49 +08:00

29 lines
837 B
TypeScript

import { BaseService } from '../BaseService'
import type { BaseResponse } from '@/types/api'
import type {
SystemConfigItem,
SystemConfigPageResult,
SystemConfigQueryParams,
UpdateSystemConfigRequest
} from '@/types/api/systemConfig'
const SYSTEM_CONFIG_BASE_URL = '/api/admin/system-configs'
export class SystemConfigService extends BaseService {
static getSystemConfigs(
params?: SystemConfigQueryParams
): Promise<BaseResponse<SystemConfigPageResult>> {
return this.get<BaseResponse<SystemConfigPageResult>>(SYSTEM_CONFIG_BASE_URL, params)
}
static updateSystemConfig(
key: string,
data: UpdateSystemConfigRequest
): Promise<BaseResponse<SystemConfigItem>> {
return this.put<BaseResponse<SystemConfigItem>>(
`${SYSTEM_CONFIG_BASE_URL}/${encodeURIComponent(key)}`,
data
)
}
}