From 07ddc8f8e76dd76a50fd9555c1385fc27745320b Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Thu, 31 Oct 2024 17:28:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A=E4=B9=89=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=20Query=20=E5=8F=82=E6=95=B0=E9=87=8D=E5=A4=8D=E8=A7=A3?= =?UTF-8?q?=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【【接口测试】github#32188,场景详情里,自定义请求,点击&取消url后面的引用环境,query参数会重复添加,场景是postman文件导入的】 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001044216 Signed-off-by: fit2-zhao --- .../scenario/common/CustomizeReqInfo.vue | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/common/CustomizeReqInfo.vue b/api-test/frontend/src/business/automation/scenario/common/CustomizeReqInfo.vue index 37f0390d15..92ef6a62be 100644 --- a/api-test/frontend/src/business/automation/scenario/common/CustomizeReqInfo.vue +++ b/api-test/frontend/src/business/automation/scenario/common/CustomizeReqInfo.vue @@ -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, + }) + ); + } } } });