diff --git a/backend/src/main/java/io/metersphere/api/service/APITestService.java b/backend/src/main/java/io/metersphere/api/service/APITestService.java index 9e48420f56..a886c9ed3a 100644 --- a/backend/src/main/java/io/metersphere/api/service/APITestService.java +++ b/backend/src/main/java/io/metersphere/api/service/APITestService.java @@ -318,11 +318,13 @@ public class APITestService { List resourceIds = schedules.stream() .map(Schedule::getResourceId) .collect(Collectors.toList()); - ApiTestExample example = new ApiTestExample(); - example.createCriteria().andIdIn(resourceIds); - List apiTests = apiTestMapper.selectByExample(example); - Map apiTestMap = apiTests.stream().collect(Collectors.toMap(ApiTest::getId, ApiTest::getName)); - scheduleService.build(apiTestMap, schedules); + if (!resourceIds.isEmpty()) { + ApiTestExample example = new ApiTestExample(); + example.createCriteria().andIdIn(resourceIds); + List apiTests = apiTestMapper.selectByExample(example); + Map apiTestMap = apiTests.stream().collect(Collectors.toMap(ApiTest::getId, ApiTest::getName)); + scheduleService.build(apiTestMap, schedules); + } return schedules; } } diff --git a/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue b/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue index 0bb0fa5c5d..f7f84b005c 100644 --- a/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue +++ b/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue @@ -18,6 +18,7 @@ import MsMainContainer from "../../../common/components/MsMainContainer"; import MsAsideItem from "../../../common/components/MsAsideItem"; import EnvironmentEdit from "./environment/EnvironmentEdit"; + import {listenGoBack, removeGoBackListener} from "../../../../../common/js/utils"; export default { name: "ApiEnvironmentConfig", @@ -45,10 +46,11 @@ } }, methods: { - open(projectId) { + open: function (projectId) { this.visible = true; this.projectId = projectId; this.getEnvironments(); + listenGoBack(this.close); }, deleteEnvironment(environment, index) { if (environment.id) { @@ -134,6 +136,7 @@ this.$emit('close'); this.visible = false; this.$refs.environmentEdit.clearValidate(); + removeGoBackListener(this.close); } } } diff --git a/frontend/src/business/components/api/test/components/import/ApiImport.vue b/frontend/src/business/components/api/test/components/import/ApiImport.vue index be6572e96a..6d939fcab6 100644 --- a/frontend/src/business/components/api/test/components/import/ApiImport.vue +++ b/frontend/src/business/components/api/test/components/import/ApiImport.vue @@ -95,6 +95,7 @@