fix: 修正formData类型的数据会被错误过滤的问题 (#272)

This commit is contained in:
PDieE 2022-08-19 16:40:45 +08:00 committed by GitHub
parent 71a841929a
commit 490ca9570d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,11 @@ const transform: AxiosTransform = {
if (formatDate) {
formatRequestDate(params);
}
if (Reflect.has(config, 'data') && config.data && Object.keys(config.data).length > 0) {
if (
Reflect.has(config, 'data') &&
config.data &&
(Object.keys(config.data).length > 0 || data instanceof FormData)
) {
config.data = data;
config.params = params;
} else {