From 611788b01bdc8c7a4e10374ea7f75e1d623ff2a0 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 19 Aug 2022 14:27:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=8E=A7=E5=88=B6=E5=99=A8=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1015823 --user=赵勇 【接口测试】github#16871,jemter函数${__V拼接变量在条件控制器中不生效 https://www.tapd.cn/55049933/s/1227720 --- .../api/dto/definition/request/controller/MsIfController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2262361cf2..f3b66964d1 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 @@ -103,7 +103,8 @@ public class MsIfController extends MsTestElement { public String getCondition() { String key = getContentValue(); - String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) ? "\"" + this.variable + "\"" : "vars.get('" + key + "')"; + String variable = (StringUtils.isEmpty(key) || key.equals(this.variable)) || key.startsWith("__V") ? + StringUtils.join("\"", this.variable, "\"") : StringUtils.join("vars.get('", key, "')"); String operator = this.operator; String value; if (StringUtils.equals(operator, "<") || StringUtils.equals(operator, ">")) {