From 4e4c5e6bba97bb4e6b788b759a8d2b12aa7efefe Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 29 Dec 2025 01:47:02 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E6=B7=BB=E5=8A=A0=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BD=93=E5=A4=84=E7=90=86=E6=AD=A5=E9=AA=A4=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/enhance/route.ts | 4 ++++ 1 file changed, 4 insertions(+) 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;