bug: 使用 axios 发送 get 请求时参数有问题
BuptStEve opened this issue · comments
StEve YoUng commented
版本
Version 1.2.0
描述一下 bug
简洁清晰地描述一下 bug。如果方便的话,添加一些截图描述你的问题。
使用 axios 发送 get 请求时,若在 apiConfig 中填写的 params 为对象形式,由于会被透传给 axios 所以最后参数会有冗余字段。
复现 bug
复现的步骤:
- 首先 apiConfig 中
export default {
type: 'get',
reqType: 'axios',
pathList: [
{
path: 'foo',
params: { a: { required: true } },
},
],
}
- 调用接口
exampleApi.foo({ a: '123' })
- 调用的接口参数是
?a=123&a=%7Brequired%3Atrue%7D
预期行为
没有多余参数