Browse Source

fix: api.ts Change the parameter passing method

pull/10903/head
zhangrenyang 3 years ago
parent
commit
0393413cf4
  1. 21
      src/services/ant-design-pro/api.ts

21
src/services/ant-design-pro/api.ts

@ -60,11 +60,14 @@ export async function rule(
});
}
/** 新规则 PUT /api/rule */
/** 新规则 PUT /api/rule */
export async function updateRule(options?: { [key: string]: any }) {
return request<API.RuleListItem>('/api/rule', {
method: 'PUT',
...(options || {}),
method: 'POST',
data:{
method: 'update',
...(options || {}),
}
});
}
@ -72,14 +75,20 @@ export async function updateRule(options?: { [key: string]: any }) {
export async function addRule(options?: { [key: string]: any }) {
return request<API.RuleListItem>('/api/rule', {
method: 'POST',
...(options || {}),
data:{
method: 'post',
...(options || {}),
}
});
}
/** 删除规则 DELETE /api/rule */
export async function removeRule(options?: { [key: string]: any }) {
return request<Record<string, any>>('/api/rule', {
method: 'DELETE',
...(options || {}),
method: 'POST',
data:{
method: 'delete',
...(options || {}),
}
});
}

Loading…
Cancel
Save