双份cookie存储:raw_cookie 保存App原始凭据,与网页运行ck分离

网页运行ck(cookie列)含本地随机生成的网页设备字段,若被风控标记
无法还原纯净登录凭据;新增 raw_cookie 保存16字段App原始态,供
设备态重建/审计/复核登录有效性。

- HuyaAccount 加 raw_cookie 列(alembic 0034,MySQL TEXT nullable)
- HuyaLoginResult 加 raw_cookie 字段;App登录链补齐前快照原始凭据
- upsert_huya_cookie 支持双写;app-password-login 路由透传 raw_cookie
- 存量行 raw_cookie 为 NULL(老账号无快照),新登录自动填充
This commit is contained in:
yml2213
2026-09-01 23:15:20 +08:00
parent 3ae1c3de1e
commit 61eb434138
7 changed files with 66 additions and 4 deletions
+4
View File
@@ -369,6 +369,10 @@ class HuyaAccount(Base):
account_password: Mapped[str] = mapped_column(EncryptedText(), default="")
nickname: Mapped[str] = mapped_column(String(128), default="")
cookie: Mapped[str] = mapped_column(EncryptedText(), nullable=False)
# App 登录原始凭据(16 字段 udb_*,不含本地随机生成的网页设备字段)。
# 网页运行 ckcookie 列)含 guid/_qimei_uuid42 等设备快照,若被风控标记
# 可从 raw_cookie 重建;也用于审计/复核登录有效性。
raw_cookie: Mapped[str] = mapped_column(EncryptedText(), nullable=False, default="")
tag: Mapped[str] = mapped_column(String(64), default="")
remark: Mapped[str] = mapped_column(String(256), default="")
status: Mapped[str] = mapped_column(String(32), default="imported")