mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
api url params 中支持复杂对象
This commit is contained in:
parent
2518dbedcc
commit
912d3816b3
@ -67,7 +67,18 @@ export function buildApi(
|
||||
}
|
||||
|
||||
const raw = (api.url = api.url || '');
|
||||
api.url = tokenize(api.url, data, '| url_encode');
|
||||
const idx = api.url.indexOf('?');
|
||||
|
||||
if (~idx) {
|
||||
const hashIdx = api.url.indexOf('#');
|
||||
const params = qs.parse(
|
||||
api.url.substring(idx + 1, ~hashIdx ? hashIdx : undefined)
|
||||
);
|
||||
api.url =
|
||||
api.url.substring(0, idx + 1) +
|
||||
qsstringify(dataMapping(params, data)) +
|
||||
(~hashIdx ? api.url.substring(hashIdx) : '');
|
||||
}
|
||||
|
||||
if (ignoreData) {
|
||||
return api;
|
||||
|
Loading…
Reference in New Issue
Block a user