This commit is contained in:
dekun
2026-05-30 11:57:00 +08:00
parent 4c4af4a464
commit 8ffe46a344
6 changed files with 165 additions and 14 deletions
+18
View File
@@ -95,6 +95,24 @@ bash scripts/fix_hub_deps.sh
| 改密后 | 需重新登录;旧 Cookie 失效 |
| 混用地址 | 不要用 A 浏览器标签登域名、B 标签指望 IP 已登录 |
### 2.3 本地导航 iframe 嵌入:登录成功但一直「跳转中」/ 进不去
**原因**:父页(如 `http://192.168.8.6:5070`)跨域 `fetch` 中控 `/api/auth/login` 时,浏览器**不会**把 `Set-Cookie` 写进 iframe 里的中控站点,表现为接口 200、弹窗「登录成功」,但 iframe 仍无会话。
**处理**(中控 `git pull` 并重启 hub 后):
1. 登录接口会返回 `session_token`;父页应把 iframe 指向:
`http://中控地址/embed-auth?token=会话token&next=/monitor`
2. 若直接在 iframe 内打开中控 `/login` 登录,页面会自动走 `/embed-auth` 写入 Cookie。
3. 父页也可监听 `postMessage`,事件类型 `hub:login-ok`,字段含 `embed_auth_url`
`.env` 可选:
```env
HUB_ALLOW_EMBED=true
HUB_EMBED_ORIGINS=http://192.168.8.6:5070
```
---
## 三、监控区无数据 / 子代理异常