feat: add unified asset retry endpoint
Some checks failed
Build and Push Docker Images / changes (push) Has been cancelled
Build and Push Docker Images / build-backend (push) Has been cancelled
Build and Push Docker Images / build-frontend (push) Has been cancelled
Build and Push Docker Images / build-admin-frontend (push) Has been cancelled

This commit is contained in:
2026-04-18 11:40:10 +08:00
parent b8d3cb4644
commit 0613238a37
9 changed files with 316 additions and 91 deletions

View File

@@ -34,14 +34,6 @@ interface Story {
}> | null
}
interface ImageGenerationResponse {
image_url: string | null
generation_status: string
image_status: string
audio_status: string
last_error: string | null
}
const route = useRoute()
const router = useRouter()
@@ -93,12 +85,9 @@ async function generateImage() {
error.value = ''
try {
const result = await api.post<ImageGenerationResponse>(`/api/image/generate/${story.value.id}`)
story.value.image_url = result.image_url
story.value.generation_status = result.generation_status
story.value.image_status = result.image_status
story.value.audio_status = result.audio_status
story.value.last_error = result.last_error
story.value = await api.post<Story>(`/api/stories/${story.value.id}/assets/retry`, {
assets: ['image'],
})
} catch (e) {
error.value = e instanceof Error ? e.message : '图片生成失败'
await refreshStorySnapshot().catch(() => undefined)