如果本来就是 formData 则跳过转换

This commit is contained in:
2betop 2021-08-31 14:51:03 +08:00
parent e45d5e9f27
commit 465e456803

View File

@ -248,7 +248,10 @@ export function wrapFetcher(
api.requestAdaptor && (api = api.requestAdaptor(api) || api);
if (api.data && (hasFile(api.data) || api.dataType === 'form-data')) {
api.data = object2formData(api.data, api.qsOptions);
api.data =
api.data instanceof FormData
? api.data
: object2formData(api.data, api.qsOptions);
} else if (
api.data &&
typeof api.data !== 'string' &&