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 74518d25e9..380d39c2c3 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -190,7 +190,7 @@ public class ApiDefinitionService { .andProtocolEqualTo(request.getProtocol()).andPathEqualTo(request.getPath()) .andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId()); Project project = projectMapper.selectByPrimaryKey(request.getProjectId()); - if (apiDefinitionMapper.countByExample(example) > 0 && !project.getRepeatable()) { + if (apiDefinitionMapper.countByExample(example) > 0 && (project.getRepeatable() == null || !project.getRepeatable())) { MSException.throwException(Translator.get("api_definition_url_not_repeating")); } } else { diff --git a/frontend/src/business/components/api/definition/components/response/ResponseResult.vue b/frontend/src/business/components/api/definition/components/response/ResponseResult.vue index f5a15b7517..c6f64ebdcc 100644 --- a/frontend/src/business/components/api/definition/components/response/ResponseResult.vue +++ b/frontend/src/business/components/api/definition/components/response/ResponseResult.vue @@ -105,8 +105,10 @@ return; } if (this.response.headers.indexOf("Content-Type: application/json") > 0) { - this.$refs.modeDropdown.handleCommand(BODY_FORMAT.JSON); - this.msCodeReload(); + if (this.$refs.modeDropdown) { + this.$refs.modeDropdown.handleCommand(BODY_FORMAT.JSON); + this.msCodeReload(); + } } }, msCodeReload() {