fix(接口测试): 修复自定义请求 Query 参数重复解析问题
【【接口测试】github#32188,场景详情里,自定义请求,点击&取消url后面的引用环境,query参数会重复添加,场景是postman文件导入的】 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001044216 Signed-off-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
parent
57db563ec9
commit
07ddc8f8e7
|
@ -151,16 +151,20 @@ export default {
|
|||
let keyValues = param.split('=');
|
||||
if (keyValues) {
|
||||
this.isUrl = true;
|
||||
this.request.arguments.splice(
|
||||
0,
|
||||
0,
|
||||
new KeyValue({
|
||||
name: keyValues[0],
|
||||
required: false,
|
||||
value: keyValues[1],
|
||||
isEdit: false,
|
||||
})
|
||||
);
|
||||
// 检查参数是否已经存在
|
||||
const existingParam = this.request.arguments.find((arg) => arg.name === keyValues[0]);
|
||||
if (!existingParam) {
|
||||
this.request.arguments.splice(
|
||||
0,
|
||||
0,
|
||||
new KeyValue({
|
||||
name: keyValues[0],
|
||||
required: false,
|
||||
value: decodeURIComponent(keyValues[1] || ''), // 解码值
|
||||
isEdit: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue