Implement CHIS session validation
This commit is contained in:
+17
@@ -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)`
|
||||
|
||||
输入:
|
||||
|
||||
Reference in New Issue
Block a user