feat: add Yuheng ticket bind, trial SMS off, shared bindings

Ship ticket-exchange and bind/policy for Z13, keep trial binds SMS-free, allow shared company bindings, and align SyncPage plus sync docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
whm
2026-08-05 15:09:49 +08:00
parent f90245db9c
commit d195aa4804
19 changed files with 957 additions and 96 deletions

View File

@@ -47,15 +47,18 @@ postgres://user:pass@127.0.0.1:5432/app_online?sslmode=disable
| 1 | 确认公司默认同步 DSN`DefaultRemoteDSN`)指向生产 Postgres |
| 2 | 「用户管理」**启用智能体** → 平台自动创建 `is_system_default` 通道,并写回该智能体 `channel_id` / `online_db_id` |
| 3 | (可选)`POST /api/v1/admin/bind-codes` 生成绑定码,发给终端用户 |
| 4 | 终端:已绑则换票带 `sync_bound=true`;未绑则 **绑定码兑换** **手机号 lookup→确认**(同号必须弹窗,禁止静默绑) |
| 4 | 终端:已绑则换票带 `sync_bound=true`;未绑则 **绑定码兑换**、**宇恒凭票****手机号 lookup→确认**(同号必须弹窗,禁止静默绑) |
| 5 | 宇恒本机库选「同步」→ 自动 Binding + agent drain本地未装 agent 仍可保存,文案「需 agent 才上云」 |
同号硬约束:宇恒手机 = 公司成员手机(联调样例 **`13531041944`**)→ 必须询问「已有账号是否绑定」;**勿用**超管号 `13531041945`
**试运行**`SMS.RequireForBind=false`(或 `Provider=off`)关闭绑定短信;仍须确认。正式接短信后改为 `true`。宇恒可先 `GET /api/v1/auth/bind/policy``trial_mode` / `yuheng_ticket_enabled`
换票 / 自查:
- `POST /api/v1/auth/token``channel_id` / `online_db_id` / `database_name` / `sync_bound`
- `GET /api/v1/agents/me`(智能体 Bearer
- `POST /api/v1/auth/yuheng/ticket-exchange`(仅宇恒 HMAC 凭票)
## 运维高级:手建通道(过渡 / 多机)