政策
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
49
src/services/cms/policyInfo.ts
Normal file
49
src/services/cms/policyInfo.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
// 查询政策列表
|
||||
export async function getPolicyInfoList(params?: API.PolicyInfo.Params) {
|
||||
return request<API.PolicyInfo.PolicyInfoResult>('/api/cms/policyInfo/list', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取政策详情
|
||||
export async function getPolicyInfoDetail(id: number) {
|
||||
return request<API.PolicyInfo.PolicyInfoDetailResult>(`/api/cms/policyInfo/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 新增政策
|
||||
export async function addPolicyInfo(data: Partial<API.PolicyInfo.PolicyInfoItem>) {
|
||||
return request<API.Result>('/api/cms/policyInfo', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改政策
|
||||
export async function updatePolicyInfo(data: Partial<API.PolicyInfo.PolicyInfoItem>) {
|
||||
return request<API.Result>('/api/cms/policyInfo', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除政策
|
||||
export async function deletePolicyInfo(ids: string) {
|
||||
return request<API.Result>(`/api/cms/policyInfo/${ids}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
// 上传政策文件
|
||||
export async function uploadPolicyFile(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
return request<API.PolicyInfo.UploadResult>('/api/cms/policyInfo/upload', {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user