diff --git a/app/api/enhance/route.ts b/app/api/enhance/route.ts index 595823248..19a667503 100644 --- a/app/api/enhance/route.ts +++ b/app/api/enhance/route.ts @@ -197,7 +197,9 @@ export async function POST(request: NextRequest) { } // 2. 获取请求体(Base64图片或FormData) + console.log("[Enhance API] 开始获取请求体..."); const contentType = request.headers.get("content-type") || ""; + console.log("[Enhance API] Content-Type:", contentType); let imageBase64: string; let prompt = ""; // 用户提示词(可选) @@ -206,7 +208,9 @@ export async function POST(request: NextRequest) { if (contentType.includes("application/json")) { // JSON格式:Base64图片 + console.log("[Enhance API] 解析JSON请求体..."); const body = await request.json(); + console.log("[Enhance API] JSON请求体解析完成,image_base64长度:", body.image_base64?.length || 0); imageBase64 = body.image_base64; prompt = body.prompt || "图片变清晰处理"; chatId = body.chatId || null;