feat(media): 作品保存恢复 - 按原任务重试交付并避免重复生成计费

This commit is contained in:
ddCat
2026-09-22 15:47:24 +08:00
parent acbb354e97
commit 48a82ded74
49 changed files with 1710 additions and 50 deletions

View File

@@ -27,6 +27,8 @@ export type GenerationTask = {
status: TaskStatus;
progress?: number;
stage?: string;
mediaStage?: "download" | "upload" | "local_save" | "register" | "completed" | "checkpoint";
canRecoverMedia?: boolean;
prompt: string;
operation?: string;
provider?: string;
@@ -282,6 +284,10 @@ export function retryGenerationTask(id: string) {
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/retry`);
}
export function recoverGenerationTaskMedia(id: string) {
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/recover-media`);
}
export function cancelGenerationTask(id: string) {
return http.post<GenerationTask>(`/tasks/${encodeURIComponent(id)}/cancel`).then((task) => {
window.dispatchEvent(new CustomEvent("canvas:task-cancelled", { detail: { task } }));