diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java index 4e7d40702c..96d2f1a4cc 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiDefinitionImportUtilService.java @@ -848,6 +848,11 @@ public class ApiDefinitionImportUtilService { apiTestCaseWithBLOBs.setCreateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); apiTestCaseWithBLOBs.setUpdateUserId(Objects.requireNonNull(SessionUtils.getUser()).getId()); apiTestCaseWithBLOBs.setCreateTime(System.currentTimeMillis()); + JSONObject o = JSONUtil.parseObject(apiTestCaseWithBLOBs.getRequest()); + if (o != null) { + o.put("projectId", apiTestCaseWithBLOBs.getProjectId()); + apiTestCaseWithBLOBs.setRequest(o.toString()); + } BeanUtils.copyBean(apiTestCaseDTO, apiTestCaseWithBLOBs); apiTestCaseDTO.setUpdated(false); apiTestCaseMapper.insert(apiTestCaseWithBLOBs); diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue index d3d07916c1..2fc40b81af 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue @@ -991,6 +991,7 @@ export default { this.apiCase.request.headers = []; this.apiCase.request.headers.push(new KeyValue({ enable: true, name: '', value: '' })); } + this.apiCase.request.projectId = this.apiCase.projectId; if (this.apiCase.request.hashTree) { this.initStepSize(this.apiCase.request.hashTree); this.historicalDataProcessing(this.apiCase.request.hashTree);