This commit is contained in:
eric
2026-03-10 07:36:33 -05:00
parent ed0a94c467
commit dbb421ed5a

View File

@@ -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 });
}