From ec091bd43cad6731b0e03e4d2cc2fc257a609063 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 24 Sep 2021 10:36:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96)=20=E4=BF=AE=E5=A4=8D=E5=8F=98=E9=87=8F=E6=8F=90?= =?UTF-8?q?=E5=8F=96=E9=97=AE=E9=A2=98=20--bug=3D1004055=20--user=3D?= =?UTF-8?q?=E8=B5=B5=E5=8B=87=20=E3=80=90github#3415=E3=80=91xml=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=9A=84response=EF=BC=8C=E8=84=9A=E6=9C=AC=E6=96=AD?= =?UTF-8?q?=E8=A8=80=E6=97=A0=E6=B3=95=E9=80=9A=E8=BF=87=EF=BC=8Cjavax.scr?= =?UTF-8?q?ipt.ScriptException=E5=BC=82=E5=B8=B8=20https://www.tapd.cn/550?= =?UTF-8?q?49933/s/1051066?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/api/jmeter/JMeterVars.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java index e43b4a2ecc..a2900fb1d5 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/JMeterVars.java @@ -43,6 +43,7 @@ public class JMeterVars { for (String item : extracts) { String nrKey = item + "_matchNr"; Object nr = vars.get(nrKey); + JMeterVariables jMeterVariables = new JMeterVariables(); if (nr != null) { int nrv = 0; try { @@ -55,10 +56,14 @@ public class JMeterVars { data.add(vars.get(item + "_" + i)); } String array = JSON.toJSONString(data); - vars.put(item, array); + jMeterVariables.put(item, array); } } - vs.put(item, vars.get(item) == null ? "" : vars.get(item)); + if (jMeterVariables.get(item) != null) { + vs.put(item, jMeterVariables.get(item)); + } else { + vs.put(item, vars.get(item) == null ? "" : vars.get(item)); + } } vs.remove("TESTSTART.MS"); // 标示变量移除 }