diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index 8eb0f3aa9a..bc34ce8c34 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -514,11 +514,13 @@ public class ApiDefinitionService { } this.setModule(test); apiDefinitionMapper.updateByPrimaryKeySelective(test); - // 同步修改用例 - List ids = new ArrayList<>(); - ids.add(request.getId()); - apiTestCaseService.updateByApiDefinitionId(ids, test.getPath(), test.getMethod(), test.getProtocol()); - //saveFollows(test.getId(), request.getFollows()); + + // 同步修改用例路径 + if (StringUtils.equals(test.getProtocol(), "HTTP")) { + List ids = new ArrayList<>(); + ids.add(request.getId()); + apiTestCaseService.updateByApiDefinitionId(ids, test.getPath(), test.getMethod(), test.getProtocol()); + } return test; } diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioVariables.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioVariables.vue index 8c7f0947b0..50dd810124 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioVariables.vue @@ -56,22 +56,26 @@ }, methods: { remove: function (index) { - this.items.splice(index, 1); - this.$emit('change', this.items); + if(this.items) { + this.items.splice(index, 1); + this.$emit('change', this.items); + } }, change: function () { let isNeedCreate = true; let removeIndex = -1; - this.items.forEach((item, index) => { - if (!item.name && !item.value) { - // 多余的空行 - if (index !== this.items.length - 1) { - removeIndex = index; + if(this.items) { + this.items.forEach((item, index) => { + if (!item.name && !item.value) { + // 多余的空行 + if (index !== this.items.length - 1) { + removeIndex = index; + } + // 没有空行,需要创建空行 + isNeedCreate = false; } - // 没有空行,需要创建空行 - isNeedCreate = false; - } - }); + }); + } if (isNeedCreate) { this.items.push(new KeyValue({enable: true})); } diff --git a/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue b/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue index c692d6be57..c6654488a1 100644 --- a/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/definition/components/ApiScenarioVariables.vue @@ -1,7 +1,7 @@ diff --git a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue index 60ff7c46a5..4c2931e1fe 100644 --- a/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue +++ b/frontend/src/business/components/api/definition/components/EditCompleteContainer.vue @@ -78,12 +78,10 @@
-
-
@@ -263,9 +261,6 @@ export default { this.$emit("refresh"); }, changeTab(tabType) { - if (this.$refs.apiConfig) { - this.$refs.apiConfig.handleSave(); - } this.refreshButtonActiveClass(tabType); }, removeListener() {