feat: 日志优化

This commit is contained in:
zdl
2025-10-18 17:33:15 +08:00
parent a7695c7365
commit 47fcb570c0
10 changed files with 80 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
import { createContext, useContext, useState, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import { useAuth } from './AuthContext';
import { logger } from '../utils/logger';
const AuthModalContext = createContext();
@@ -69,7 +70,10 @@ export const AuthModalProvider = ({ children }) => {
try {
onSuccessCallback(user);
} catch (error) {
console.error('Success callback error:', error);
logger.error('AuthModalContext', 'handleLoginSuccess', error, {
userId: user?.id,
hasCallback: !!onSuccessCallback
});
}
}