tuax / tua-api

🏗 一款可配置的通用 api 请求函数生成工具(A common tool helps converting configs to api functions)

Home Page:https://tuax.github.io/tua-api/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: 填写 `{ required: false }` 时传参有问题

BuptStEve opened this issue · comments

版本
Version v1.3.2

描述一下 bug
简洁清晰地描述一下 bug。如果方便的话,添加一些截图描述你的问题。

当配置接口参数为 required: false 时,合并默认参数有问题。

复现 bug
复现的步骤:

  1. 填写对象配置
export default {
  ...
  pathList: [
    { 
      path: 'foo', 
      params: {
        bar: { required: false },
      },
    },
  ],
}
  1. 请求链接中参数会变成这样

?bar=%5Bobject%20Object%5D

预期行为
简洁清晰地描述一下预期行为。

当填写 { required: false } 或其他对象类型时,当做空字符串处理。