From 662d78ed174eebc7cf029bc0207fb6f949ff1eb0 Mon Sep 17 00:00:00 2001 From: baiqi Date: Tue, 29 Oct 2024 14:26:27 +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=A3=E7=94=A8=E4=BE=8B=E5=81=9C=E6=AD=A2=E6=89=A7?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../management/components/management/case/caseDetail.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/api-test/management/components/management/case/caseDetail.vue b/frontend/src/views/api-test/management/components/management/case/caseDetail.vue index 0c694599f6..006e46050b 100644 --- a/frontend/src/views/api-test/management/components/management/case/caseDetail.vue +++ b/frontend/src/views/api-test/management/components/management/case/caseDetail.vue @@ -138,8 +138,9 @@ import TabCaseDependency from '@/views/api-test/management/components/management/case/tabContent/tabCaseDependency.vue'; import TabCaseExecuteHistory from '@/views/api-test/management/components/management/case/tabContent/tabCaseExecuteHistory.vue'; - import { localExecuteApiDebug, stopExecute, stopLocalExecute } from '@/api/modules/api-test/common'; + import { localExecuteApiDebug, stopLocalExecute } from '@/api/modules/api-test/common'; import { debugCase, deleteCase, runCase, toggleFollowCase } from '@/api/modules/api-test/management'; + import { projectStopTask } from '@/api/modules/taskCenter/project'; import useModal from '@/hooks/useModal'; import useWebsocket from '@/hooks/useWebsocket'; import useAppStore from '@/store/modules/app'; @@ -304,6 +305,7 @@ await createSocket(); websocket.value = _websocket.value; } + const executeTaskId = ref(''); async function handleExecute(executeType?: 'localExec' | 'serverExec') { try { caseDetail.value.executeLoading = true; @@ -332,6 +334,7 @@ if (executeType === 'localExec') { await localExecuteApiDebug(executeRef.value?.localExecuteUrl as string, res); } + executeTaskId.value = res.taskInfo?.taskId; // 执行完更新执行历史 executeHistoryRef.value?.loadExecuteList(); } catch (error) { @@ -346,7 +349,7 @@ if (caseDetail.value.frontendDebug) { await stopLocalExecute(executeRef.value?.localExecuteUrl || '', reportId.value, ScenarioStepType.API_CASE); } else { - await stopExecute(reportId.value, ScenarioStepType.API_CASE); + await projectStopTask(executeTaskId.value); } } catch (error) { // eslint-disable-next-line no-console