实现虎牙充值商品列表与支付二维码

This commit is contained in:
yml2213
2026-07-04 23:48:53 +08:00
parent fa0d49ff8c
commit 5513b5a313
12 changed files with 1209 additions and 61 deletions
+4 -4
View File
@@ -13,12 +13,12 @@ from ..models import HuyaAccount, HuyaConfig, HuyaTask
SUPPORTED_TASK_TYPES = {
"get_bind_qr": "获取绑定二维码",
"query_points": "一键查询积分",
"open_elite_book": "开通精英宝典",
"recharge_points": "充值积分",
"query_game_name": "一键查询游戏名",
"query_exchange_records": "一键查询兑换记录",
"confirm_bind": "确认绑定",
"refresh_goods": "刷新商品列表",
"refresh_recharge_goods": "刷新充值商品列表",
"create_recharge_order": "生成支付二维码",
}
@@ -172,8 +172,8 @@ def create_planned_tasks(
batch_id = uuid.uuid4().hex[:12]
payload = payload or {}
accounts = db.query(HuyaAccount).filter(HuyaAccount.id.in_(account_ids)).all()
if task_type == "refresh_goods" and accounts:
# 商品列表是全局快照,使用一个可用 CK 刷新即可。
if task_type in {"refresh_goods", "refresh_recharge_goods", "create_recharge_order"} and accounts:
# 全局快照和单笔支付二维码都使用一个选中的 CK 即可。
accounts = accounts[:1]
for account in accounts:
db.add(HuyaTask(