From 339d44d2f29a8bbc2c8960e2c6d27d2b7e7cde30 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Wed, 1 Mar 2023 15:51:23 +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=8DIF=E9=80=BB=E8=BE=91=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=99=A8=E6=9D=A1=E4=BB=B6=E7=94=9F=E6=88=90=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/metersphere/metersphere/issues/22366 --- .../dto/definition/request/controller/MsIfController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java index 0dd4e8d65a..6ace05b232 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/controller/MsIfController.java @@ -102,8 +102,11 @@ public class MsIfController extends MsTestElement { public String getCondition() { String key = getContentValue(); - String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) || key.startsWith("__V") ? - StringUtils.join("\"", this.variable, "\"") : StringUtils.join("vars.get('", key, "')"); + + String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) || key.startsWith("__") + ? StringUtils.join("\"", this.variable, "\"") + : StringUtils.join("vars.get('", key, "')"); + String operator = this.operator; String value; if (StringUtils.equals(operator, "<") || StringUtils.equals(operator, ">")) {