From 7bad977e1d889b6939e8bf7b4247d9fbea837d56 Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Thu, 28 Nov 2024 15:21:08 +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=E6=94=B9=E6=8E=A5=E5=8F=A3=E8=B7=AF=E5=BE=84=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/commons/utils/mock/MockApiUtils.java | 9 ++++----- .../environment/commons/ApiScenarioVariables.vue | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java b/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java index a5dcb6841e..8d87c8b74b 100644 --- a/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java +++ b/api-test/backend/src/main/java/io/metersphere/commons/utils/mock/MockApiUtils.java @@ -740,7 +740,7 @@ public class MockApiUtils { String urlItem = urlParams[urlIndex]; String customUrlItem = pathArr[pathArr.length - urlParams.length + urlIndex]; // 不为rest参数的要进行全匹配。 而且忽略大小写 - if (isRestUrlParam(customUrlItem) && isRestUrlParam(urlItem)) { + if (isNotRestUrlParam(customUrlItem) && isNotRestUrlParam(urlItem)) { if (!StringUtils.equalsIgnoreCase(customUrlItem, urlItem)) { isFetch = false; break; @@ -752,7 +752,6 @@ public class MockApiUtils { } } } else { - if (path.startsWith("/")) { path = path.substring(1); } @@ -763,8 +762,8 @@ public class MockApiUtils { for (int i = 0; i < urlParams.length; i++) { String pathItem = pathArr[i]; String urlItem = urlParams[i]; - if (!(isRestUrlParam(pathItem)) && !(isRestUrlParam(urlItem))) { - if (!StringUtils.equals(pathArr[i], urlParams[i])) { + if (isNotRestUrlParam(pathItem) && isNotRestUrlParam(urlItem)) { + if (!StringUtils.equalsIgnoreCase(pathArr[i], urlParams[i])) { isFetch = false; break; } @@ -785,7 +784,7 @@ public class MockApiUtils { return false; } - private static boolean isRestUrlParam(String urlParam) { + private static boolean isNotRestUrlParam(String urlParam) { return !StringUtils.startsWith(urlParam, "{") || !StringUtils.endsWith(urlParam, "}") || StringUtils.equals(urlParam, "{}"); } diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index 66848b3d57..6395a21aef 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -168,6 +168,8 @@ v-if="scope.row.type !== 'CSV'" :placeholder="valueText(scope.row)" @change="changeVariableVal(scope.row)" + :maxlength="5000" + show-word-limit :disabled=" scope.row.type === 'COUNTER' || scope.row.type === 'RANDOM' "