From f845c967c3f7bbb72e40632a05d6dd861da32ed3 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 28 Jun 2023 19:19:06 +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=8D=E5=88=B7=E6=96=B0=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1026638 --user=王孝刚 【接口测试】接口列表-切换http/tcp/sql/dubbo-刷新页面-列表显示问题 https://www.tapd.cn/55049933/s/1387865 --- .../api/dto/definition/request/ElementUtil.java | 4 ++-- .../frontend/src/business/definition/ApiDefinition.vue | 10 ++++++---- .../business/definition/components/list/ApiList.vue | 4 ++-- .../definition/components/module/ApiModule.vue | 10 ++++++---- .../apache/jmeter/assertions/JSONPathAssertion.java | 2 -- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java index 23fc42033c..291e79aed3 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/ElementUtil.java @@ -738,7 +738,7 @@ public class ElementUtil { variables.stream() .filter(ScenarioVariable::isConstantValid).forEach(keyValue -> arguments.addArgument(keyValue.getName(), - keyValue.getValue(), "=")); + keyValue.getValue().replaceAll("[\r\n]",""), "=")); List variableList = variables.stream() .filter(ScenarioVariable::isListValid).collect(Collectors.toList()); variableList.forEach(item -> { @@ -761,7 +761,7 @@ public class ElementUtil { arguments.addArgument(keyValue.getName(), keyValue.getValue() != null && keyValue.getValue().startsWith("@") ? ScriptEngineUtils.buildFunctionCallString(keyValue.getValue()) - : keyValue.getValue(), "=")); + : keyValue.getValue().replaceAll("[\r\n]",""), "=")); // List类型的变量 List variableList = config.getConfig().get(projectId).getCommonConfig().getVariables().stream() .filter(ScenarioVariable::isListValid) diff --git a/api-test/frontend/src/business/definition/ApiDefinition.vue b/api-test/frontend/src/business/definition/ApiDefinition.vue index c2e4979646..0b68d40ff2 100644 --- a/api-test/frontend/src/business/definition/ApiDefinition.vue +++ b/api-test/frontend/src/business/definition/ApiDefinition.vue @@ -375,7 +375,7 @@ export default { selectDataRange: 'all', showCasePage: true, apiDefaultTab: 'default', - currentProtocol: 'HTTP', + currentProtocol: '', currentModule: null, selectNodeIds: [], currentApi: {}, @@ -481,6 +481,11 @@ export default { this.isAsideHidden = this.apiDefaultTab === 'default' || this.apiDefaultTab === 'trash'; }, }, + beforeCreate() { + getUserDefaultApiType().then(response => { + this.currentProtocol = response.data; + }) + }, created() { let routeParamObj = this.$route.params; if (routeParamObj) { @@ -507,9 +512,6 @@ export default { this.activeDom = 'middle'; } } - getUserDefaultApiType().then(response => { - this.currentProtocol = response.data; - }) this.getEnv(); }, mounted() { diff --git a/api-test/frontend/src/business/definition/components/list/ApiList.vue b/api-test/frontend/src/business/definition/components/list/ApiList.vue index 26924e51f6..a8fc97992b 100644 --- a/api-test/frontend/src/business/definition/components/list/ApiList.vue +++ b/api-test/frontend/src/business/definition/components/list/ApiList.vue @@ -867,7 +867,7 @@ export default { }, refreshTable() { this.initTableCondition(); - if (this.condition.projectId) { + if (this.condition.projectId && this.condition.protocol) { this.result = getDefinitionPage(this.currentPage, this.pageSize, this.condition).then((response) => { getProtocolFilter(this.condition.protocol); this.total = response.data.itemCount; @@ -881,7 +881,7 @@ export default { }, initTable(currentProtocol) { this.initTableCondition(currentProtocol); - if (this.condition.projectId) { + if (this.condition.projectId && this.condition.protocol) { this.result = getDefinitionPage(this.currentPage, this.pageSize, this.condition).then((response) => { getProtocolFilter(this.condition.protocol); this.total = response.data.itemCount; diff --git a/api-test/frontend/src/business/definition/components/module/ApiModule.vue b/api-test/frontend/src/business/definition/components/module/ApiModule.vue index 710edec334..bed2da7663 100644 --- a/api-test/frontend/src/business/definition/components/module/ApiModule.vue +++ b/api-test/frontend/src/business/definition/components/module/ApiModule.vue @@ -78,7 +78,7 @@ export default { result: false, refreshDataOver: true, condition: { - protocol: OPTIONS[0].value, + protocol: '', filterText: '', trashEnable: false, }, @@ -245,9 +245,11 @@ export default { this.setData(response); }); } else { - this.result = postApiModules(projectId, this.condition.protocol, this.currentVersion, this.param).then((response) => { - this.setData(response); - }); + if (this.condition.protocol) { + this.result = postApiModules(projectId, this.condition.protocol, this.currentVersion, this.param).then((response) => { + this.setData(response); + }); + } } }, setNohupData(response, selectNodeId) { diff --git a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java index 7541bb9d88..d3d555bc0d 100644 --- a/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java +++ b/framework/sdk-parent/jmeter/src/main/java/org/apache/jmeter/assertions/JSONPathAssertion.java @@ -283,8 +283,6 @@ public class JSONPathAssertion extends AbstractTestElement implements Serializab try { Number number1 = NumberUtils.createBigDecimal(v1); Number number2 = NumberUtils.createBigDecimal(v2); - log.info("number1: " + number1 + " number2: " + number2); - log.info("number1.equals(number2): " + number1.equals(number2)); return number1.equals(number2); } catch (Exception e) { return StringUtils.equals(v1, v2);