feat(auth): 预加载用户数据并优化登录状态同步

- 在启动屏预加载用户 token 与资料,避免首页白屏
- 新增 rehydrateUserSync 同步注入 Redux,减少异步等待
- 登录页兼容 ERR_REQUEST_CANCELED 取消场景
- 各页面统一依赖 isLoggedIn 判断,移除冗余控制台日志
- 步数卡片与详情页改为实时拉取健康数据,不再缓存至 Redux
- 后台任务注册移至顶层,防止重复定义
- 体重记录、HeaderBar 等 UI 细节样式微调
This commit is contained in:
richarjiang
2025-09-15 09:56:42 +08:00
parent 55d133c470
commit 91df01bd79
18 changed files with 967 additions and 1018 deletions

View File

@@ -1,4 +1,3 @@
import { HourlyStepData } from '@/utils/health';
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import { AppDispatch, RootState } from './index';
@@ -13,7 +12,6 @@ export interface FitnessRingsData {
}
export interface HealthData {
steps: number | null;
activeCalories: number | null;
basalEnergyBurned: number | null;
hrv: number | null;
@@ -25,7 +23,6 @@ export interface HealthData {
exerciseMinutesGoal: number;
standHours: number;
standHoursGoal: number;
hourlySteps: HourlyStepData[];
}
export interface HealthState {