From 6c188f3f885c85f114257e76a3a99a0747e4b0d1 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 5 Feb 2021 16:38:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=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=BD=93=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E4=B9=89=E6=97=B6=20=E5=BD=B1=E5=93=8DIF?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E6=88=96=E9=9D=9E=E7=A9=BA=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/dto/definition/request/controller/MsIfController.java | 4 ++-- .../dto/definition/request/controller/MsLoopController.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java index acbfa04709..2c273cfc4c 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java @@ -79,13 +79,13 @@ public class MsIfController extends MsTestElement { } if (StringUtils.equals(operator, "is empty")) { - variable = "!empty(" + variable + ")"; + variable = variable + "==" + "\"\\" + this.variable + "\"" + "|| empty(" + variable + ")"; operator = ""; value = ""; } if (StringUtils.equals(operator, "is not empty")) { - variable = "empty(" + variable + ")"; + variable = variable + "!=" + "\"\\" + this.variable + "\"" + "&& !empty(" + variable + ")"; operator = ""; value = ""; } diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java index 3d05319d2b..b22949ed2a 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsLoopController.java @@ -123,13 +123,13 @@ public class MsLoopController extends MsTestElement { } if (StringUtils.equals(operator, "is empty")) { - variable = "!empty(" + variable + ")"; + variable = variable + "==" + "\"\\" + this.whileController.getVariable() + "\"" + "|| empty(" + variable + ")"; operator = ""; value = ""; } if (StringUtils.equals(operator, "is not empty")) { - variable = "empty(" + variable + ")"; + variable = variable + "!=" + "\"\\" + this.whileController.getVariable() + "\"" + "&& !empty(" + variable + ")"; operator = ""; value = ""; }