feat: 登陆状态调整

This commit is contained in:
zdl
2025-10-20 13:58:07 +08:00
parent b2681231b0
commit d695f8ff7b
8 changed files with 37 additions and 70 deletions

View File

@@ -112,7 +112,7 @@ export default function CenterDashboard() {
} finally {
setLoading(false);
}
}, [user]);
}, [user?.id]); // 只依赖 user.id,避免无限循环
// 加载实时行情
const loadRealtimeQuotes = useCallback(async () => {
@@ -198,7 +198,7 @@ export default function CenterDashboard() {
};
document.addEventListener('visibilitychange', onVis);
return () => document.removeEventListener('visibilitychange', onVis);
}, [user, location.pathname, loadData]);
}, [user?.id, location.pathname, loadData]); // 只依赖 user.id,避免无限循环
// 定时刷新实时行情(每分钟一次)
useEffect(() => {