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);