From 0fd89fc6be98f6a3974b2ad505b093010ea769a3 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 27 Jul 2020 10:11:45 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20post=E8=AF=B7=E6=B1=82url=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/api/test/model/ScenarioModel.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/test/model/ScenarioModel.js b/frontend/src/business/components/api/test/model/ScenarioModel.js index 904318e101..95fae6b585 100644 --- a/frontend/src/business/components/api/test/model/ScenarioModel.js +++ b/frontend/src/business/components/api/test/model/ScenarioModel.js @@ -663,11 +663,19 @@ class JMXHttpRequest { getPostQueryParameters(request, path) { if (this.method.toUpperCase() !== "GET") { path += '?'; + let parameters = []; request.parameters.forEach(parameter => { - if (parameter.name) { - path += ((parameter.name) + '=' + (parameter.value) + '&'); + if (parameter.name && parameter.value) { + parameters.push(parameter); } }); + for (let i = 0; i < parameters.length; i++) { + let parameter = parameters[i]; + path += (encodeURIComponent(parameter.name) + '=' + encodeURIComponent(parameter.value)); + if (i != parameters.length -1) { + path += '&'; + } + } } return path; }