初步增加, 扫码登录成功

This commit is contained in:
yml2213
2026-08-12 16:22:55 +08:00
parent 7db3b2cd4f
commit d19c0902f2
60 changed files with 7413 additions and 315 deletions
@@ -0,0 +1,27 @@
"""YYB mall APIs require different session fields for WeChat and QQ OAuth."""
from __future__ import annotations
WECHAT_APPID = "wxd44977328b36e647"
QQ_APPID = "102033112"
def midas_login_params(cookies: dict[str, str]) -> dict[str, str]:
"""Build the provider-specific Midas session fields from OAuth cookies."""
login_type = str(cookies.get("logintype", cookies.get("login_type", "WX"))).upper()
if login_type == "QC":
return {
"openid": cookies.get("openid", ""),
"openkey": cookies.get("accesstoken", ""),
"session_id": "openid",
"session_type": "kp_accesstoken",
"wx_appid": "",
"qq_appid": cookies.get("appid", QQ_APPID),
}
return {
"openid": cookies.get("openid", ""),
"openkey": cookies.get("accesstoken", ""),
"session_id": "hy_gameid",
"session_type": "wc_actoken",
"wx_appid": cookies.get("appid", WECHAT_APPID),
"qq_appid": "",
}