Files
Nexus/docs/audit/2026-06-07-settings-telegram-detect-chat-id.md
T

44 lines
1.4 KiB
Markdown
Raw Normal View History

# 审计 — 设置页 Telegram Chat ID 检测恢复
## 范围
| 文件 | 变更 |
|------|------|
| `frontend/src/pages/SettingsPage.vue` | 恢复「检测 Chat ID」按钮与选择对话框 |
| `frontend/src/types/api.ts` | `TelegramChatsResponse` 类型 |
| `deploy/install_ops_cron.sh` | crontab 改用 `bash` 调用(避免 +x 丢失) |
| `deploy/deploy-production.sh` | `PORT` 缺省 8600(同日前序 commit |
| `deploy/gate_log.jsonl` | 门控记录(自动生成) |
## 结论
- 后端 `GET /settings/telegram/chats` 未删,仅 Vue 设置页遗漏 UI
- 无 API 契约变更;检测前若 Token 草稿存在则先 PUT 保存
## Step 3 规则扫描
| H | 规则 | 结论 |
|---|------|------|
| H1 | Chat ID 检测 API 仍存在 | PASS — `GET /settings/telegram/chats` 未改 |
| H2 | Vue 设置页功能对等 | FIXED — 恢复检测按钮与对话框 |
| H3 | Token 未保存时检测 | FIXED — 检测前自动 PUT token 草稿 |
## Closure
| H | 判定 | 依据 |
|---|------|------|
| H1 | PASS | `server/api/settings.py` `telegram_get_chats` |
| H2 | FIXED | `SettingsPage.vue` `detectTelegramChats` |
| H3 | FIXED | 检测前 `http.put telegram_bot_token` |
## DoD
- [x] 前端 vite build 通过
- [x] changelog / audit 已写
- [x] 无 API 破坏性变更
## 验证
- `cd frontend && npx vite build` 通过
- 设置页:Bot 收消息后检测 → 列表 → 选中写入 Chat ID