feat: 日志优化
This commit is contained in:
@@ -19,6 +19,7 @@ import { useAuth } from '../../contexts/AuthContext';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import heroBg from '../../assets/img/BackgroundCard1.png';
|
||||
import '../../styles/home-animations.css';
|
||||
import { logger } from '../../utils/logger';
|
||||
|
||||
export default function HomePage() {
|
||||
const { user, isAuthenticated } = useAuth(); // ⚡ 移除 isLoading,不再依赖它
|
||||
@@ -27,15 +28,12 @@ export default function HomePage() {
|
||||
|
||||
// 保留原有的调试信息
|
||||
useEffect(() => {
|
||||
console.log('🏠 HomePage AuthContext 状态:', {
|
||||
user,
|
||||
logger.debug('HomePage', 'AuthContext状态', {
|
||||
userId: user?.id,
|
||||
username: user?.username,
|
||||
nickname: user?.nickname,
|
||||
isAuthenticated,
|
||||
hasUser: !!user,
|
||||
userInfo: user ? {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
nickname: user.nickname
|
||||
} : null
|
||||
hasUser: !!user
|
||||
});
|
||||
}, [user, isAuthenticated]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user