mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: api 在 patch 时支持 body (#3815)
* chore: api 在 patch 和 delete 时也支持 body * delete 不传递 body * 补充文档
This commit is contained in:
parent
d961b42753
commit
0a5a1861c4
@ -136,7 +136,7 @@ API 还支持配置对象类型
|
||||
|
||||
### 配置请求方式
|
||||
|
||||
可以配置`method`指定接口的请求方式,支持:`get`、`post`、`put`、`delete`。
|
||||
可以配置`method`指定接口的请求方式,支持:`get`、`post`、`put`、`delete`、`patch`。
|
||||
|
||||
> `method`值留空时:
|
||||
>
|
||||
|
@ -125,7 +125,11 @@ export function buildApi(
|
||||
undefined,
|
||||
api.convertKeyToPath
|
||||
);
|
||||
} else if (api.method === 'post' || api.method === 'put') {
|
||||
} else if (
|
||||
api.method === 'post' ||
|
||||
api.method === 'put' ||
|
||||
api.method === 'patch'
|
||||
) {
|
||||
api.body = api.data = cloneObject(data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user