From ba8b017ab984351aaa3bbfc696611f0ba931bccb Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Wed, 15 Jun 2022 10:30:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3CASE=E5=A4=8D=E5=88=B6=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=8E=A5=E5=8F=A3=E5=90=8D=E7=A7=B0=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=E6=98=BE=E7=A4=BA=E4=BA=86ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1014075 【接口测试】【特殊数据】接口CASE复制后,显示接口名称的地方显示了ID https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014075 --- .../components/list/ApiCaseSimpleList.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index a613445dca..fce69a4a35 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -867,7 +867,15 @@ export default { }); }, handleCopy(row) { - this.$get('/api/testcase/findById/' + row.id, (response) => { + this.$get('/api/definition/get/' + row.apiDefinitionId, (response) => { + let api = response.data; + if (api) { + this.getCaseAndOpen(row.id, api.name, row.apiDefinitionId); + } + }); + }, + getCaseAndOpen(id, apiName, apiId) { + this.$get('/api/testcase/findById/' + id, (response) => { let data = response.data; let uuid = getUUID(); let apiCaseRequest = JSON.parse(data.request); @@ -877,9 +885,10 @@ export default { } else if (apiCaseRequest.type === "JDBCSampler") { apiCaseRequest.method = "SQL"; } + apiCaseRequest.name = apiName; let obj = { name: "copy_" + data.name, - apiDefinitionId: row.apiDefinitionId, + apiDefinitionId: apiId, versionId: data.versionId, priority: data.priority, active: true,