diff --git a/app/api/watermark-remove/route.ts b/app/api/watermark-remove/route.ts index b38702c1a..4d0b2eaef 100644 --- a/app/api/watermark-remove/route.ts +++ b/app/api/watermark-remove/route.ts @@ -56,13 +56,13 @@ async function pollForResult(taskId: string, apiKey: string): Promise<{ success: // 检查任务状态 if (result.data?.state === 1) { - // 任务完成 - const imageUrl = result.data?.image; + // 任务完成 - PicWish API 返回 "file" 字段 + const imageUrl = result.data?.file || result.data?.image; if (imageUrl) { return { success: true, imageUrl }; } return { success: false, error: "处理完成但未返回图片URL" }; - } else if (result.data?.state === -1) { + } else if (result.data?.state === -1 || result.data?.state < 0) { // 任务失败 return { success: false, error: result.data?.error || "去水印处理失败" }; }