diff --git a/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue b/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue index 6ae3a1f5ff..f797e433d8 100644 --- a/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue +++ b/frontend/src/business/components/api/definition/components/assertion/document/DocumentBody.vue @@ -218,8 +218,10 @@ export default { }, getDocument() { // 来自场景步骤,请求id为用例id - if (this.document && this.document.nodeType && (this.document.nodeType === "scenario" || this.document.nodeType === "Case")) { + if (this.document && this.document.nodeType && this.document.nodeType === "scenario") { this.getCase(); + } else if (this.document && this.document.nodeType && this.document.nodeType === "Case" && this.document.apiDefinitionId) { + this.getAPI(this.document.apiDefinitionId); } else { this.getAPI(); } diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 9d3c543ef4..a197caa588 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -314,7 +314,8 @@ export default { if (this.apiCase.request && this.apiCase.request.hashTree && this.apiCase.request.hashTree.length > 0) { this.apiCase.request.hashTree.forEach(item => { if (item.type === 'Assertions') { - item.document.nodeType = 'Case' + item.document.nodeType = 'Case'; + item.document.apiDefinitionId = this.apiCase.apiDefinitionId; } }) }