v0.7.0 接上真实服务器:登录 / 设备会话 / 全量同步与各模块真实数据

从「演示数据壳子」走到「真的能连家里的服务器用」。

登录(用户 2026-10-17「完整的登录功能」)
  · 首次启动先填服务器地址 → /api/v1/ping 自报门户(认得出"这地址上真是家书")
  · 手机号或用户名 + 密码 → 拿令牌;失败提示统一,不泄露账号是否存在
  · FbDeviceStore:首次启动生成并持久化设备 UUID(三方应用拿不到 UDID),
    设备名取机型(marketName),并上报 platform / app_version

设备会话(v57,用户 2026-10-17)
  · 一把令牌 = 一台设备的一条会话;每次启动打一次 /me(有网就验)
  · 两种锁分开:need_login(401/被踢 → 清令牌)与 offline_expired
    (离线超 24h → 只锁界面、不清数据、联网自动恢复)——
    混成一种就会违背用户要的"一直联网就不用每天输密码"
  · 运行期任何请求 401 → 网络层全局回调立刻锁定跳登录页(FbHttp 的 authProbe
    让登录/校验类请求跳过,避免"两个地方同时跳登录页")
  · 退出登录:先清本地令牌(主防线),再尽力通知服务端
  · 设置页显示版本号与「这台设备」

数据层
  · FbDb / FbSchema / FbParse / 各 Repo(日程 / 名册 / 观影 / 模块)+ FbSyncAll
  · 首页改为服务端 /home(农历/节气/纪念日/生日/天气/统计/往年的今天)
  · 日程页用 FbDayEventPanel,与网页端显示方式/红线/并排三处一致

验证:ArkTS 静态守卫 231/0;hvigor 编译 BUILD SUCCESSFUL(entry-default-signed.hap)。
This commit is contained in:
2026-10-18 03:36:04 +08:00
parent 7eaa641437
commit 776c95ba0b
64 changed files with 18297 additions and 1519 deletions
@@ -0,0 +1,61 @@
/**
* 家书 FamilyBook · 各模块的「设置菜单」条目(鸿蒙端)
*
* 🔴 用户 2026-10-16:「所有页面的设置按钮全部都改成和网页版一致,
* 就是**三个横线**那种设置按钮。」
*
* 这份表**逐条对齐网页版** `templates/<模块>/_settings_menu.php` 里的菜单项
* (那是权威来源;别自己发明条目)。
*
* ⚠️ `action` 为**空串** = 该功能在鸿蒙端**还没做**:
* 界面会画成灰色 + 「暂未开放」,点它**不响应**
* (比"点了没反应"好 —— 后者用户以为是卡了)。
* ⚠️ 补上某个功能时,只要把对应 `action` 填上、并在页面里处理它即可;
* 表本身不用改结构。
*/
import { FbSettingItem } from '../components/FbModuleSettingsSheet';
/** 观影(对应网页版 templates/movies/_settings_menu.php) */
export const FB_SET_MOVIES: FbSettingItem[] = [
{ icon: 'movies', label: '影院管理', hint: '看过的影院,按名字排', action: 'cinema' },
{ icon: 'search', label: '高级搜索', hint: '按年份 / 类型 / 评分筛', action: '' },
{ icon: 'chart', label: '统计', hint: '每年看了多少、类型分布', action: '' },
{ icon: 'notes', label: '年度报告', hint: '一句话总结这一年', action: '' }
];
/** 读书(templates/books/_settings_menu.php) */
export const FB_SET_BOOKS: FbSettingItem[] = [
{ icon: 'chart', label: '读书统计', hint: '每年读了多少、多少页', action: '' },
{ icon: 'plus', label: '导入读书笔记', hint: '从笔记文件批量导入', action: '' },
{ icon: 'share', label: '微信读书导入', hint: '同步微信读书的书单', action: '' }
];
/** 纪念日(templates/days/_settings_menu.php) */
export const FB_SET_DAYS: FbSettingItem[] = [
{ icon: 'filter', label: '纪念日分类', hint: '全家共用一套分类', action: '' }
];
/** 账本(templates/ledger/_settings_menu.php) */
export const FB_SET_LEDGER: FbSettingItem[] = [
{ icon: 'share', label: '共享给谁', hint: '对方就能记能看', action: '' },
{ icon: 'edit', label: '账本名字', hint: '改这本账本的名字', action: '' }
];
/** 任务(templates/tasks/_settings_menu.php) */
export const FB_SET_TASKS: FbSettingItem[] = [
{ icon: 'tasks', label: '分类与看板', hint: '管分类、管看板', action: '' },
{ icon: 'check', label: '已完成', hint: '看已经完成的任务', action: '' }
];
/** 旅程(templates/trips/_settings_menu.php) */
export const FB_SET_TRIPS: FbSettingItem[] = [
{ icon: 'nav', label: '车辆管理', hint: '自驾时的车与油耗', action: '' },
{ icon: 'trips', label: '出行方式', hint: '飞机 / 高铁 / 自驾…', action: '' },
{ icon: 'dot', label: '节点类型', hint: '行程节点的类型', action: '' }
];
/** 资源(网页版没有独立菜单;这里只放已有的入口) */
export const FB_SET_RESOURCES: FbSettingItem[] = [
{ icon: 'filter', label: '格式筛选', hint: '只看某类资源', action: '' }
];