Merge branch 'develop' of https://github.com/HBAI-Ltd/Toonflow-app into develop

This commit is contained in:
ACT丶流星雨 2026-03-02 16:07:46 +08:00
commit af4cce8fb6
2 changed files with 10 additions and 4 deletions

View File

@ -42,7 +42,6 @@ export default async (input: ImageConfig, config: AIConfig): Promise<string> =>
}, },
}, },
}, },
timeout: 60000,
}); });
if (!result.files.length) { if (!result.files.length) {

View File

@ -38,6 +38,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
if (input?.audio) { if (input?.audio) {
requestBody.generate_audio = input.audio ?? false; requestBody.generate_audio = input.audio ?? false;
} }
// 创建视频生成任务 // 创建视频生成任务
const createResponse = await axios.post(baseUrl, requestBody, { const createResponse = await axios.post(baseUrl, requestBody, {
headers: { headers: {
@ -56,7 +57,7 @@ export default async (input: VideoConfig, config: AIConfig) => {
headers: { Authorization: authorization }, headers: { Authorization: authorization },
}); });
const { status, content } = data.data; const { status, content, error } = data.data;
switch (status) { switch (status) {
case "succeeded": case "succeeded":
@ -64,7 +65,13 @@ export default async (input: VideoConfig, config: AIConfig) => {
case "failed": case "failed":
case "cancelled": case "cancelled":
case "expired": case "expired":
return { completed: false, error: `任务${status}` }; let errorMsg = "";
try {
errorMsg = typeof error === "string" ? error : JSON.stringify(error);
} catch (e) {
errorMsg = error || "";
}
return { completed: false, error: `任务${status}: ${errorMsg}` };
case "queued": case "queued":
case "running": case "running":
return { completed: false }; return { completed: false };