wangjia
|
b37c46fb9c
|
refactor(client): widgets 颜色迁移到 context.tokens
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-24 23:12:20 +08:00 |
|
wangjia
|
32bd64d676
|
feat(client): 实时授权状态与会话失效处理
- 心跳读取 /auth/ping 回带的授权概况,直接刷新横幅/状态栏/只读门禁,省去单独轮询 /license/info
- 账号被停用/删除(401 USER_DISABLED)即强制重新登录
- 令牌持久化经串行队列 + 会话代号守卫,杜绝续期写入与登出交叉把失效 token 写回
- 写操作门禁(write_guard)+ 授权文案(license_copy)按 grace/readonly/locked 分阶段降级
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-06-19 07:34:07 +08:00 |
|
wangjia
|
f5c41e04f3
|
fix: 修复测试 schema 缺失字段,标记过时测试为 skip
- testutil/setup.go 补充 products.public_id、description,partners.status
- 过时 products/stock 流程测试标记 skip(provider 已不挂载)
- deploy.sh 补充 PUBLIC_URL dart-define
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-30 00:46:25 +08:00 |
|
wangjia
|
5dd7c07138
|
feat(client): 网络恢复自动刷新 + 离线嗅探 + 连通性感知登录
网络嗅探与自动恢复:
- ConnectivityNotifier:在线时 30s 检测,离线时切换为 1min 嗅探
- 新增 networkRecoveryCountProvider:网络恢复时自增,各数据 provider
通过 ref.watch 实现自动重新加载
- inventory/product/stock_in/stock_out/partner provider 均已接入
FutureBuilder 类屏幕:
- finance_screen + batch_tracking_screen 通过 ref.listen 监听恢复事件
修复问题 1:API 超时 10s/30s → 5s/15s,减少无网络时等待
修复问题 2:offline banner 文字由"写操作已禁用"改为实际行为描述
连通性感知:
- app 启动时(_AppBootstrap)立即 forceCheck,路由跳转前状态已就绪
- 登录页:watch connectivityProvider,离线时显示警告 banner
- 登录按钮:离线状态下直接提示,不等待超时
测试:
- login_screen_test + login_flow_test 通过 ConnectivityNotifier(skipInit: true)
覆盖 provider,避免测试环境中 pending HTTP timer
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
2026-04-18 19:52:17 +08:00 |
|