Implement CHIS session validation

This commit is contained in:
ila
2026-07-05 11:13:34 +08:00
parent 07e6c2b9a3
commit 83c1100aa8
7 changed files with 100 additions and 10 deletions
+17
View File
@@ -178,6 +178,23 @@ ChisLoginSession(
- 从 `Set-Cookie` 提取 `JSESSIONID`,组装 CHIS cookie。
- 登录失败、缺少允许角色、缺少 cookie 时抛出 `ChisLoginError`,错误对象包含稳定 `code`。
### `ChisLoginClient.get_lander_info(cookie)`
输入:
```python
cookie: str
```
输出:CHIS `chis.myPageService / getLanderInfo` 原始字典响应。
职责:
- 使用已有 CHIS cookie 调用 `*.jsonRequest?`。
- 请求体固定为 `serviceId=chis.myPageService`、`serviceAction=getLanderInfo`、`method=execute`。
- 成功时返回当前账号信息响应。
- CHIS 返回非 200 业务码时抛出 `ChisLoginError(code="chis_session_invalid")`,用于判断会话无效。
### `ChisSessionManager.ensure_session(account_ref)`
输入: