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
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user