新增 使用后端返回的snapshot

This commit is contained in:
moux1024 2025-10-15 01:07:28 +08:00
parent 399c0deab1
commit c76c259ba8
2 changed files with 6 additions and 3 deletions

View File

@ -367,6 +367,8 @@ export interface VideoFlowProjectResponse {
data: ProjectContentData; data: ProjectContentData;
/** 最终简单视频 */ /** 最终简单视频 */
final_simple_video: string; final_simple_video: string;
/** 最终简单视频封面图 */
final_simple_video_snapshot_url: string;
/** 最终视频 */ /** 最终视频 */
final_video: string; final_video: string;
/** 画面比例 */ /** 画面比例 */

View File

@ -415,7 +415,7 @@ export function useWorkflowData({}: UseWorkflowDataProps = {}) {
throw new Error(response.message); throw new Error(response.message);
} }
const { status, data, tags, mode, original_text, aspect_ratio, name, final_simple_video, final_video } = response.data; const { status, data, tags, mode, original_text, aspect_ratio, name, final_simple_video, final_simple_video_snapshot_url, final_video } = response.data;
const { current: taskCurrent } = tempTaskObject; const { current: taskCurrent } = tempTaskObject;
@ -532,6 +532,7 @@ export function useWorkflowData({}: UseWorkflowDataProps = {}) {
if (final_simple_video) { if (final_simple_video) {
taskCurrent.currentStage = 'final_video'; taskCurrent.currentStage = 'final_video';
taskCurrent.final.url = final_simple_video; taskCurrent.final.url = final_simple_video;
taskCurrent.final.snapshot_url = final_simple_video_snapshot_url;
taskCurrent.final.note = 'simple'; taskCurrent.final.note = 'simple';
taskCurrent.status = 'COMPLETED'; taskCurrent.status = 'COMPLETED';
} }
@ -555,7 +556,7 @@ export function useWorkflowData({}: UseWorkflowDataProps = {}) {
originalText: original_text, originalText: original_text,
isLoading: false isLoading: false
}); });
// 设置步骤 // 设置步骤
setTaskObject(prev => { setTaskObject(prev => {
const newState = JSON.parse(JSON.stringify({...prev, ...taskCurrent})); const newState = JSON.parse(JSON.stringify({...prev, ...taskCurrent}));
return newState; return newState;