update pay function

This commit is contained in:
2025-11-22 10:37:15 +08:00
parent 40b57c1a81
commit 15d521dd59
7 changed files with 450 additions and 4 deletions

View File

@@ -13,11 +13,13 @@ export function useAuth() {
useEffect(() => {
// 组件挂载时检查认证状态
const verifyAuth = async () => {
console.log('[useAuth] Starting auth verification...');
try {
const info = await checkAuth();
console.log('[useAuth] Auth info received:', info);
setAuthInfo(info);
} catch (error) {
console.error('Auth verification failed:', error);
console.error('[useAuth] Auth verification failed:', error);
setAuthInfo({
isAuthenticated: false,
message: '认证检查失败',
@@ -36,7 +38,10 @@ export function useAuth() {
}, []);
return {
...authInfo,
user: authInfo.user,
isAuthenticated: authInfo.isAuthenticated || false,
canAccessChat: authInfo.canAccessChat || false,
message: authInfo.message,
loading,
refresh: async () => {
setLoading(true);