update pay function

This commit is contained in:
2025-11-22 09:16:12 +08:00
parent 7498e87d31
commit 092c86f3d2
5 changed files with 171 additions and 2 deletions

View File

@@ -22,8 +22,12 @@ export interface AuthInfo {
*/
export async function checkAuth(): Promise<AuthInfo> {
try {
// 使用硬编码的 URL 作为后备
const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://49.232.185.254:5001';
console.log('API URL:', apiUrl); // 调试日志
// 调用主应用的 session 检查接口
const response = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/auth/session`, {
const response = await fetch(`${apiUrl}/api/auth/session`, {
credentials: 'include', // 重要:携带 Cookie
headers: {
'Content-Type': 'application/json',