feat(login): kg/tx 登录态自动续期(移植 lx-music-api-server 方案)

- kg: login_by_token 续期(AES-256-CBC + RSA 裸加密,参考其 refresh/kg.py),新 token 回写 data/auth.json
- tx: 新增 sdk/auth/tx.ts —— cookie 解析、VIP 检测(vip_login_base)、
  music.login.LoginServer 续期(走既有 musicu.fcg 未签名通道,最佳努力)
- 调度:启动 10s 后首刷 + 每 24h 一次(对齐参考项目 86400s + next_run_time=now)
- /login/tx 支持可选 App 抓包凭据(openId/accessToken/refreshToken/refreshKey)
- 新增 POST /login/refresh 手动续期;/login/status 增补 tx 字段与更新时间
- 补充 /login/tx 文档行与 smoke 测试
This commit is contained in:
snowy-yang committed 2026-09-29 20:16:33 +08:00
1 parent 9d7cb6f39a
commit aca7928019
8 files changed
+300 -9

No files matched your search

+8
View File
@@ -34,6 +34,14 @@ export interface KgDevice {
export interface TxCredentials {
cookie: string
// App 抓包的完整凭据(可选):提供后可自动续期(music.login.LoginServer),
// 仅浏览器 cookie 时 qm_keyst 无法主动续期,只能做 VIP 检测
openId?: string
accessToken?: string
refreshToken?: string
refreshKey?: string
uin?: string
vipType?: 'svip' | 'vip' | 'normal' | null
updatedAt?: string
}