Merge pull request #456 from bigshans/patch-1
perf: 已经是 FormData 对象的不用再次转换
This commit is contained in:
commit
3d1c8a8a3d
|
@ -14,7 +14,8 @@ const defaultRequestInterceptors = (config: InternalAxiosRequestConfig) => {
|
||||||
} else if (
|
} else if (
|
||||||
TRANSFORM_REQUEST_DATA &&
|
TRANSFORM_REQUEST_DATA &&
|
||||||
config.method === 'post' &&
|
config.method === 'post' &&
|
||||||
config.headers['Content-Type'] === 'multipart/form-data'
|
config.headers['Content-Type'] === 'multipart/form-data' &&
|
||||||
|
!(config.data instanceof FormData)
|
||||||
) {
|
) {
|
||||||
config.data = objToFormData(config.data)
|
config.data = objToFormData(config.data)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue