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

@@ -236,7 +236,7 @@ export const fetchMyProfile = createAsyncThunk('user/fetchMyProfile', async (_,
try {
// 固定使用后端文档的接口:/api/users/info
const data: any = await api.get('/api/users/info');
console.log('fetchMyProfile', data);
const profile: UserProfile = (data as any).profile ?? (data as any).user ?? (data as any).account ?? (data as any);
await AsyncStorage.setItem(STORAGE_KEYS.userProfile, JSON.stringify(profile ?? {}));
return profile;