feat: 日志优化
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user