docs(plans): 记录 K19 账号中心交付回执

This commit is contained in:
Zhou Weidong committed 2026-10-19 09:56:22 +08:00
1 parent 6b5e70e554
commit 28d2679b83
2 files changed
+225 -1

No files matched your search

+169
View File
@@ -2202,6 +2202,175 @@ $ flutter test
---
## 34. K19 客户端账号中心
### 34.1 基线与实施范围
基线确认:
```text
ReelShort: 7d68699 fix(config): 合并开发默认服务器地址
FruitServer: 5c93ba9 docs(plans): 下发 K19 账号中心接口对接任务
```
计划文档先提交为 `6b5e70e docs(plans): 增加 K19 账号中心实施计划`。
客户端从干净 develop 创建 `feature/flutter-k19-account`,只对接:
```text
GET /app/me
PUT /app/me
GET /app/me/devices
GET /app/me/export
POST /app/me/deactivate
POST /app/me/deactivate/cancel
```
接口口径以后端实际代码为准:设备直接返回实体数组;导出返回
`profile / credentials / consents / devices`;注销请求只发送 `reason`。
### 34.2 TDD 与实现
先用不存在的 `AccountApi/AccountProfile` 跑红灯,确认测试在实现前失败:
```text
Error: Error when reading 'lib/core/data/remote/account_api.dart':
No such file or directory
Some tests failed.
```
第一批实现后:
```text
$ flutter test test/account/account_api_test.dart
00:00 +7: All tests passed!
```
登录态同步先红灯:
```text
Error: The method 'applyProfile' isn't defined for the type 'AuthController'.
```
实现 `applyProfile(AuthUser)` 后:
```text
00:00 +1: All tests passed!
```
逻辑层覆盖资料保存回调、设备读取、导出复制、注销清会话和撤销失败文案:
```text
$ flutter test test/account/account_logic_test.dart
00:00 +5: All tests passed!
```
页面与入口先红灯,随后用稳定 Key 实现:
```text
$ flutter test test/account/account_pages_test.dart \
test/account/mine_account_entry_test.dart
00:01 +6: All tests passed!
```
实现文件:
```text
lib/core/data/remote/account_api.dart
lib/core/data/models/account_profile.dart
lib/core/data/models/account_device.dart
lib/core/data/models/account_export.dart
lib/core/data/repositories/account_repository.dart
lib/pages/account/*
lib/pages/mine/mine_view.dart
lib/core/data/services/auth_controller.dart
lib/app.dart
lib/l10n/app_{en,zh,id}.arb
```
### 34.3 首屏布局回归
首次全量测试时,新增账号卡把既有偏好设置和观看历史入口挤出可视区:
```text
Found 0 widgets with text "App Language"
Found 0 widgets with text "Watch History"
Some tests failed.
```
处理:不改既有测试断言,把账号卡收敛为 48px 紧凑横向入口,
保留四项图标、分隔线和账号标题;原有菜单项改用紧凑密度。
三个受影响测试回归:
```text
$ flutter test test/home/home_nav_ui_test.dart \
test/watch/watch_history_provider_test.dart test/widget_test.dart
00:06 +21: All tests passed!
```
### 34.4 最终门禁
```text
$ dart analyze lib test
Analyzing lib, test...
No issues found!
```
```text
$ flutter test
00:26 +335: All tests passed!
```
```text
$ flutter build apk --debug
Running Gradle task 'assembleDebug'... 10.0s
✓ Built build/app/outputs/flutter-apk/app-debug.apk
```
### 34.5 Git
```text
44f6feb feat(account): 接入个人中心接口模型
ef7f4ce feat(account): 同步资料保存后的登录态
c68f024 feat(account): 增加账号中心页面逻辑
da09511 feat(account): 增加账号中心页面与入口
6fce24d refactor(account): 收敛账号页组件结构
7151bc9 style(account): 保持账号入口首屏可用
9b3ab9d feat(account): 合并 K19 账号中心
7d68699..9b3ab9d develop -> develop
```
所有提交 author/committer 均为 `Zhou Weidong <502333560@qq.com>`。
### 34.6 已知缺口
- 无注销状态查询:不能预先判断是否在冷静期,撤销失败直接展示后端文案。
- 无设备下线接口:设备页只读。
- 无头像上传接口:头像只展示。
- 资料响应不含生日:本批生日只能本次设置,不能回填或清空。
### 34.7 用户真机验证
以下步骤必须在设备侧执行并取证,开发机不代跑:
1. 登录后打开「我的」。
预期:钱包卡后、菜单卡前出现「账号」卡,四项入口完整可点击。
2. 打开「个人资料」。
预期:服务端字段回填;修改昵称/性别并保存后,我的页昵称同步更新。
3. 打开「登录设备」。
预期:设备号首尾可见、中间脱敏;平台、机型、时间、状态正确;空列表显示空态。
4. 打开「数据导出」。
预期:显示资料、凭据、授权记录数、设备数;复制 JSON 成功。
5. 打开「注销账号」。
预期:显示 15 天冷静期和立即登出提示;提交必须经过二次确认。
6. 确认注销。
预期:显示 `scheduledAt`,本地 token 清空并回到未登录状态。
7. 重新登录后撤销注销。
预期:有申请时成功;无申请时显示后端“没有待处理的注销申请”。
设备侧截图、日志和最终验收结论由用户执行。
---
## 2026-10-17 K10 统一空列表占位
### 26.1 范围、分支与计划