Merge pull request #456 from bigshans/patch-1

perf: 已经是 FormData 对象的不用再次转换
This commit is contained in:
Archer 2024-04-19 09:35:23 +08:00 committed by GitHub
commit 3d1c8a8a3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -14,7 +14,8 @@ const defaultRequestInterceptors = (config: InternalAxiosRequestConfig) => {
} else if (
TRANSFORM_REQUEST_DATA &&
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)
}