update pay function
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user