Commit 442bd440ba89743c60c64560c57c11acfd0461c3

Authored by newplum
Committed by GitHub
1 parent 4a4321a7

fix(axios): 非GET请求时增加判断config.data是否为FormData (#2082)

Showing 1 changed file with 1 additions and 1 deletions
src/utils/http/axios/index.ts
... ... @@ -111,7 +111,7 @@ const transform: AxiosTransform = {
111 111 } else {
112 112 if (!isString(params)) {
113 113 formatDate && formatRequestDate(params);
114   - if (Reflect.has(config, 'data') && config.data && Object.keys(config.data).length > 0) {
  114 + if (Reflect.has(config, 'data') && config.data && (Object.keys(config.data).length > 0 || config.data instanceof FormData)) {
115 115 config.data = data;
116 116 config.params = params;
117 117 } else {
... ...