未验证 提交 e1b30a50 编写于 作者: 最后 提交者: GitHub

fix: update Axios.ts (#492)

1. 应该使用传递进来的 请求头
2. 针对有数组类型的参数,应该用brackets 或者 repeat 。  最好将arrayFormat参数改成可以让使用者通过入参来改的。  参考: https://blog.csdn.net/pifutan/article/details/86320705
上级 0649011e
......@@ -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' }),
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册