From dbb421ed5a404f77098e2612b24734601438e145 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 10 Mar 2026 07:36:33 -0500 Subject: [PATCH] 's' --- app/api/pay/route.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/api/pay/route.ts b/app/api/pay/route.ts index b3d62a9..6935950 100644 --- a/app/api/pay/route.ts +++ b/app/api/pay/route.ts @@ -125,6 +125,8 @@ export async function POST(request: NextRequest) { const type = String(body?.type || "vip"); const channel = String(body?.channel || "wxpay"); const device = String(body?.device || "pc"); + const accept = request.headers.get("accept") || ""; + const wantHtml = String(body?.html) === "1" || accept.includes("text/html"); if (!user_id) { if (wantHtml) { @@ -142,9 +144,6 @@ export async function POST(request: NextRequest) { : request.headers.get("origin") || "http://localhost:3000"; const finalReturnUrl = return_url || `${origin}/paid`; - const accept = request.headers.get("accept") || ""; - const wantHtml = String(body?.html) === "1" || accept.includes("text/html"); - if (!wantHtml) { return NextResponse.json({ ok: false, error: "请传 html=1" }, { status: 400 }); }