diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java index 218697305a..2b2005e50a 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -413,7 +413,9 @@ public class ApiAutomationService { http.setUrl(null); } else { ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId()); - http.setUrl(apiDefinition.getPath()); + if (apiDefinition != null) { + http.setUrl(apiDefinition.getPath()); + } } if (http.isEnable()) { if (StringUtils.isBlank(http.getUrl()) || !tr.isURL(http.getUrl())) { @@ -424,10 +426,14 @@ public class ApiAutomationService { } else if (StringUtils.equals(tr.getType(), "JDBCSampler") || StringUtils.equals(tr.getType(), "TCPSampler")) { if (StringUtils.equals(tr.getRefType(), "CASE")) { ApiTestCaseWithBLOBs apiTestCaseWithBLOBs = apiTestCaseService.get(tr.getId()); - env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId()); + if (apiTestCaseWithBLOBs != null) { + env.getProjectIds().add(apiTestCaseWithBLOBs.getProjectId()); + } } else { ApiDefinition apiDefinition = apiDefinitionService.get(tr.getId()); - env.getProjectIds().add(apiDefinition.getProjectId()); + if (apiDefinition != null) { + env.getProjectIds().add(apiDefinition.getProjectId()); + } } } else if (StringUtils.equals(tr.getType(), "scenario")) { if (tr.isEnable()) { diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 22f75c44c5..1932b7ff6d 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -429,7 +429,8 @@ this.setTabTitle(data); }, mockConfig(data) { - this.handleMockTabsConfig(this.$t("commons.mock"), "MOCK", data); + let targetName = this.$t("commons.mock") + "-" + data.apiName; + this.handleMockTabsConfig(targetName, "MOCK", data); }, saveApi(data) { this.setTabTitle(data); diff --git a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue index b3aecd9d1f..7fe43cd077 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -2,7 +2,6 @@
期望列表
-{{ $t('api_test.mock.expect_detail') }}
-期望列表
{{ $t('api_test.mock.expect_detail') }}
+