This commit is contained in:
eric
2026-03-13 10:59:08 -05:00
parent e673bc9b62
commit 0885e00b25
5 changed files with 59 additions and 6 deletions

View File

@@ -130,12 +130,10 @@ export async function POST(request: NextRequest) {
const payConfig = getPaymentConfig();
const hostHeader = request.headers.get("host") || request.headers.get("x-forwarded-host");
// 优先用请求 Host等同 window.location.host推断同机 payjsapi访问 192.168.41.222:3002 即用 192.168.41.222:8007
const apiUrl = (
(hostHeader ? getApiUrlFromRequest(hostHeader) : null) ||
payConfig.apiUrl
)
.replace(/\/$/, "");
).replace(/\/$/, "");
console.log("[pay] 立即加入 apiUrl=%s host=%s", apiUrl, hostHeader);
let user_id = String(body?.user_id || "").trim();
if (user_id.startsWith("{") && user_id.includes("data")) {