feat(personal): 持久化开发者模式状态并优化登录后数据加载

- 新增 kv-store 持久化开发者模式开关,避免每次冷启动丢失
- 登录成功后立即拉取用户资料,减少首页空数据闪烁
- 修复体重卡片在未登录时重复请求的问题
- 移除 ActivityHeatMap 与 userSlice 中的调试日志
- useAuthGuard 增加 token 调试输出(临时)
This commit is contained in:
richarjiang
2025-09-15 16:24:38 +08:00
parent 2357596665
commit 281149201b
7 changed files with 40 additions and 11 deletions

View File

@@ -20,6 +20,9 @@ export function useAuthGuard() {
const dispatch = useAppDispatch();
const currentPath = usePathname();
const token = useAppSelector((s) => (s as any)?.user?.token as string | null);
console.log('useAuthGuard!!!token', token);
const isLoggedIn = !!token;
const ensureLoggedIn = useCallback(async (options?: EnsureOptions): Promise<boolean> => {