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

@@ -603,7 +603,7 @@ export default function HomeNavbar() {
error: error.message
});
}
}, [isAuthenticated, user]); // 移除 getApiBase 依赖,因为它现在在组件外部
}, [isAuthenticated, user?.id]); // 只依赖 user.id,避免 user 对象变化导致无限循环
// 监听用户变化,重置检查标志(用户切换或退出登录时)
React.useEffect(() => {
@@ -622,7 +622,7 @@ export default function HomeNavbar() {
const timer = setTimeout(checkProfileCompleteness, 1000);
return () => clearTimeout(timer);
}
}, [isAuthenticated, user, checkProfileCompleteness]);
}, [isAuthenticated, user?.id, checkProfileCompleteness]); // 只依赖 user.id,避免无限循环
// 加载订阅信息
React.useEffect(() => {