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