debug: 添加请求体处理步骤的调试日志
This commit is contained in:
parent
e3f15b8bef
commit
4e4c5e6bba
@ -197,7 +197,9 @@ export async function POST(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. 获取请求体(Base64图片或FormData)
|
// 2. 获取请求体(Base64图片或FormData)
|
||||||
|
console.log("[Enhance API] 开始获取请求体...");
|
||||||
const contentType = request.headers.get("content-type") || "";
|
const contentType = request.headers.get("content-type") || "";
|
||||||
|
console.log("[Enhance API] Content-Type:", contentType);
|
||||||
|
|
||||||
let imageBase64: string;
|
let imageBase64: string;
|
||||||
let prompt = ""; // 用户提示词(可选)
|
let prompt = ""; // 用户提示词(可选)
|
||||||
@ -206,7 +208,9 @@ export async function POST(request: NextRequest) {
|
|||||||
|
|
||||||
if (contentType.includes("application/json")) {
|
if (contentType.includes("application/json")) {
|
||||||
// JSON格式:Base64图片
|
// JSON格式:Base64图片
|
||||||
|
console.log("[Enhance API] 解析JSON请求体...");
|
||||||
const body = await request.json();
|
const body = await request.json();
|
||||||
|
console.log("[Enhance API] JSON请求体解析完成,image_base64长度:", body.image_base64?.length || 0);
|
||||||
imageBase64 = body.image_base64;
|
imageBase64 = body.image_base64;
|
||||||
prompt = body.prompt || "图片变清晰处理";
|
prompt = body.prompt || "图片变清晰处理";
|
||||||
chatId = body.chatId || null;
|
chatId = body.chatId || null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user