Merge pull request #3952 from 2betop/chore-api4

chore: api 左侧路径上获取的数据有可能已经包含了问号所以得动态检测
This commit is contained in:
张涛 2022-04-02 11:31:39 +08:00 committed by GitHub
commit 485a22fe60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,8 +144,10 @@ export function buildApi(
}
});
const left = replaceExpression(url.substring(0, idx), 'raw', '');
api.url =
replaceExpression(url.substring(0, idx + 1), 'raw', '') +
left +
(~left.indexOf('?') ? '&' : '?') +
qsstringify(
(api.query = dataMapping(params, data, undefined, api.convertKeyToPath))
) +