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 f4887428e0..cf0b1a87bd 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -625,6 +625,7 @@ public class ApiDefinitionService { batchMapper.insert(apiDefinition); String requestStr = setImportHashTree(apiDefinition); reSetImportCasesApiId(cases, originId, apiDefinition.getId()); + reSetImportMocksApiId(mocks, originId, apiDefinition.getId(), apiDefinition.getNum()); apiDefinition.setRequest(requestStr); importApiCase(apiDefinition, apiTestImportRequest); } diff --git a/backend/src/main/java/io/metersphere/commons/utils/JsonStructUtils.java b/backend/src/main/java/io/metersphere/commons/utils/JsonStructUtils.java index 7b877743ec..721b407518 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/JsonStructUtils.java +++ b/backend/src/main/java/io/metersphere/commons/utils/JsonStructUtils.java @@ -30,7 +30,7 @@ public class JsonStructUtils { if(matchObj == null){ matchObj = new JSONObject(); } - if (sourceObj .isEmpty() && matchObj.isEmpty()) { + if (matchObj.isEmpty()) { return true; } else if (sourceObj != null && matchObj != null) { boolean lastMatchResultIsTrue = false; 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 cd8e98888d..d2976ac773 100644 --- a/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/EditCompleteHTTPApi.vue @@ -274,10 +274,6 @@ return this.mockBaseUrl; } else { let path = this.httpForm.path; - let prefix = ""; - if (path.endsWith("/")) { - prefix = "/"; - } let protocol = this.httpForm.method; if (protocol === 'GET' || protocol === 'DELETE') { if (this.httpForm.request != null && this.httpForm.request.rest != null) { @@ -303,8 +299,7 @@ } } } - - return this.mockBaseUrl + path + prefix; + return this.mockBaseUrl + path; } } }, diff --git a/frontend/src/business/components/api/definition/components/mock/Components/MockApiVariable.vue b/frontend/src/business/components/api/definition/components/mock/Components/MockApiVariable.vue index f4d74d035d..8a8028a7ab 100644 --- a/frontend/src/business/components/api/definition/components/mock/Components/MockApiVariable.vue +++ b/frontend/src/business/components/api/definition/components/mock/Components/MockApiVariable.vue @@ -3,16 +3,8 @@ {{ description }} - - -
- - - - - @@ -31,16 +23,19 @@ + :fetch-suggestions="querySearch" @change="change" :placeholder="keyText" show-word-limit> + + - - - - - - - - - @@ -76,12 +67,6 @@ - - - - - - @@ -102,13 +87,10 @@