From 554ba94e5d8724ba851b88a6186f14ba39932e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Tue, 21 Oct 2025 21:34:44 +0800 Subject: [PATCH] =?UTF-8?q?get=5Fstatus=E6=8E=A5=E5=8F=A3=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E6=B0=B4=E5=8D=B0=20task=20=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/work-flow/use-workflow-data.tsx | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 4258ea4..bd983e7 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -316,11 +316,16 @@ export function useWorkflowData({}: UseWorkflowDataProps = {}) { } } - // 合成视频 + // 合成视频就有水印 if (task.task_name === 'combiner_videos') { if (task.task_status === 'COMPLETED') { - combinerVideoUrl = task.task_result.video_url; - combinerVideoPoster = task.task_result.snapshot_url; + taskCurrent.currentStage = 'final_video'; + taskCurrent.final.url = task.task_result.video_url; + taskCurrent.final.note = 'combiner'; + taskCurrent.final.snapshot_url = task.task_result.snapshot_url; + taskCurrent.status = 'COMPLETED'; + // 停止轮询 + setNeedStreamData(false); } if (task.task_status === 'FAILED' || task.task_status === 'ERROR') { taskCurrent.status = 'FAILED'; @@ -329,32 +334,6 @@ export function useWorkflowData({}: UseWorkflowDataProps = {}) { } } - // 水印视频 - if (task.task_name === 'watermark_videos') { - if (task.task_status === 'COMPLETED') { - taskCurrent.currentStage = 'final_video'; - const videoUrl = task.task_result.video_url; - taskCurrent.final.url = (videoUrl && typeof videoUrl === 'object') - ? videoUrl.result?.watermarked_url - : videoUrl; - taskCurrent.final.note = 'watermark'; - taskCurrent.final.snapshot_url = combinerVideoPoster; - taskCurrent.status = 'COMPLETED'; - // 停止轮询 - setNeedStreamData(false); - } - if (task.task_status === 'FAILED' || task.task_status === 'ERROR') { - // 使用合成视频地址 - taskCurrent.currentStage = 'final_video'; - taskCurrent.final.url = combinerVideoUrl; - taskCurrent.final.note = 'combiner'; - taskCurrent.final.snapshot_url = combinerVideoPoster; - taskCurrent.status = 'COMPLETED'; - // 停止轮询 - setNeedStreamData(false); - } - } - // 最终剪辑 if (task.task_name === 'generate_final_video') { if (task.task_result && task.task_result.video) {