mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 11:07:52 +08:00
支持 api 配置成 get 携带 body, 但是 fetcher 那记得用 method-override, 否则浏览器不支持这么发送
Change-Id: I6d3b53fd61fee28b69faedcf48317684b2766ea7
This commit is contained in:
parent
c46653fa7b
commit
1ee25adddf
@ -96,6 +96,22 @@ export function buildApi(
|
||||
if (api.method === 'get') {
|
||||
if (!~raw.indexOf('$') && !api.data && autoAppend) {
|
||||
api.data = data;
|
||||
} else if (
|
||||
api.attachDataToQuery === false &&
|
||||
api.data &&
|
||||
!~raw.indexOf('$') &&
|
||||
autoAppend
|
||||
) {
|
||||
const idx = api.url.indexOf('?');
|
||||
if (~idx) {
|
||||
let params = {
|
||||
...qs.parse(api.url.substring(idx + 1)),
|
||||
...data
|
||||
};
|
||||
api.url = api.url.substring(0, idx) + '?' + qsstringify(params);
|
||||
} else {
|
||||
api.url += '?' + qsstringify(data);
|
||||
}
|
||||
}
|
||||
|
||||
if (api.data && api.attachDataToQuery !== false) {
|
||||
|
Loading…
Reference in New Issue
Block a user