Browse Source

fix: update Axios.ts (#492)

1. 应该使用传递进来的 请求头
2. 针对有数组类型的参数,应该用brackets 或者 repeat 。  最好将arrayFormat参数改成可以让使用者通过入参来改的。  参考: https://blog.csdn.net/pifutan/article/details/86320705
pull/498/head
最后 5 years ago
committed by GitHub
parent
commit
e1b30a5075
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/utils/http/axios/Axios.ts

4
src/utils/http/axios/Axios.ts

@ -155,7 +155,7 @@ export class VAxios {
// support form-data
supportFormData(config: AxiosRequestConfig) {
const headers = this.options?.headers;
const headers = config.headers;
const contentType = headers?.['Content-Type'] || headers?.['content-type'];
if (
@ -168,7 +168,7 @@ export class VAxios {
return {
...config,
data: qs.stringify(config.data),
data: qs.stringify(config.data, { arrayFormat: 'brackets' }),
};
}

Loading…
Cancel
Save