lowcode-datasource
lowcode-datasource copied to clipboard
fix: 修改fetchOptios.params数组类型转为对象问题
如图,fetchOptions的params在merge会强制把数组类型转为对象,接口参数会错误。
这里把merge加一层判断,区分有无数组情况
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
params的定义如下,应该不存在Array 的情况
export interface RuntimeOptionsConfig {
uri: string;
api?: string;
params?: Record<string, unknown>;
method?: string;
isCors?: boolean;
timeout?: number;
headers?: Record<string, unknown>;
[option: string]: unknown;
}
老兄啊,这个类型定义有问题啊。 你试试如下代码,看看是不是数组变成了对象。
this.dataSourceMap.example.load([1,2,3]).then(res => console.log(res))
我们遇到了问题才提了pr,并非是我们刷KPI,我们项目用到了低代码引擎,结果后端接口调不通,因为后端接口参数是数据类型的,所以一路排查问题到这里。 请重新排查一下,可好?