mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-24 04:10:20 +08:00
fix: update Axios.ts (#492)
1. 应该使用传递进来的 请求头 2. 针对有数组类型的参数,应该用brackets 或者 repeat 。 最好将arrayFormat参数改成可以让使用者通过入参来改的。 参考: https://blog.csdn.net/pifutan/article/details/86320705
This commit is contained in:
parent
0649011eba
commit
e1b30a5075
@ -155,7 +155,7 @@ export class VAxios {
|
|||||||
|
|
||||||
// support form-data
|
// support form-data
|
||||||
supportFormData(config: AxiosRequestConfig) {
|
supportFormData(config: AxiosRequestConfig) {
|
||||||
const headers = this.options?.headers;
|
const headers = config.headers;
|
||||||
const contentType = headers?.['Content-Type'] || headers?.['content-type'];
|
const contentType = headers?.['Content-Type'] || headers?.['content-type'];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -168,7 +168,7 @@ export class VAxios {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...config,
|
...config,
|
||||||
data: qs.stringify(config.data),
|
data: qs.stringify(config.data, { arrayFormat: 'brackets' }),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user