Files
live-hub-py/web/backend/routers/huya/__init__.py
T
yml2213 0b9a01ab3f feat(huya): 开通支付码复用未支付旧单 + 二维码改用支付宝收银台直达地址
- 限购商品(精英宝典 buy_limit=1)挂着未支付旧单时,真正先失败的是购买权限
  校验 checkUserBuyAuth(真机 703「已超过该商品的购买上限,下单失败~」),
  createOrderV5 根本不会执行;现在 checkUserBuyAuth 与 createOrderV5 两处失败
  都会回退 find_reusable_order,拿同一商品的未支付旧单继续 payOrderSubmitV5。
- 新增支付宝收银台直达地址解析(resolve_pay_entry_url):跟随网关 302 后的
  excashier.alipay.com/standard/auth.htm?payOrderId=…(93 字符,原始网关地址
  1616 字符)写入结果 pay_cashier_url;解析失败回落本站短链
  /api/huya/pay/<task_id>?k=<hmac>,后端跑在 localhost 时客户也扫得开。
- 前端 QRCode 显式 color="#000" bgColor="#fff":antd v6 暗色主题默认
  color=token.colorText、bgColor=transparent,白码落在白底容器里根本看不见。
- 支付成功后列表「二维码」列不再展示二维码(qrDoneLabel → 已支付/已开通)。

测试:pytest 767 passed / 6 skipped;typecheck、eslint、ruff 通过。
2026-10-15 19:28:26 +08:00

109 lines
2.8 KiB
Python

"""虎牙 API:按账号 / 登录 / 注册 / Cookie / 工作台 / 设备拆分。"""
from fastapi import APIRouter
from .accounts import (
assign_account,
batch_assign_accounts,
batch_tag,
batch_tag_selection,
create_browser_exchange_kit,
delete_account,
delete_accounts_batch,
delete_accounts_batch_selection,
import_cookies,
import_password_accounts,
list_accounts,
list_huya_account_ids,
list_tags,
set_account_tag,
)
from .accounts import router as accounts_router
from .cookies import router as cookies_router
from .devices import router as devices_router
from .login import (
app_password_login_account,
app_password_login_selected_accounts,
auto_sms_login_account,
fetch_account_sms_code,
password_login_account,
password_login_selected_accounts,
send_sms_code,
sms_login_account,
test_sms_url_endpoint,
)
from .login import router as login_router
from .register import router as register_router
from .workbench import (
cleanup_orphan_tasks,
create_task_batch,
get_config,
get_task,
import_workbench_cookies,
list_goods,
list_huya_workbench_accounts,
list_recharge_goods,
list_tasks,
stop_batch,
task_types,
tasks_summary,
update_config,
update_huya_workbench_accounts,
ws_huya_logs,
)
from .pay import redirect_huya_pay
from .pay import router as pay_router
from .workbench import router as workbench_router
router = APIRouter(prefix="/api/huya", tags=["虎牙"])
router.include_router(accounts_router)
router.include_router(login_router)
router.include_router(register_router)
router.include_router(cookies_router)
router.include_router(workbench_router)
router.include_router(devices_router)
router.include_router(pay_router)
__all__ = [
"app_password_login_account",
"app_password_login_selected_accounts",
"assign_account",
"auto_sms_login_account",
"batch_assign_accounts",
"batch_tag",
"batch_tag_selection",
"cleanup_orphan_tasks",
"create_browser_exchange_kit",
"create_task_batch",
"delete_account",
"delete_accounts_batch",
"delete_accounts_batch_selection",
"fetch_account_sms_code",
"get_config",
"get_task",
"import_cookies",
"import_password_accounts",
"import_workbench_cookies",
"list_accounts",
"list_goods",
"list_huya_account_ids",
"list_huya_workbench_accounts",
"list_recharge_goods",
"list_tags",
"list_tasks",
"password_login_account",
"password_login_selected_accounts",
"redirect_huya_pay",
"router",
"send_sms_code",
"set_account_tag",
"sms_login_account",
"stop_batch",
"task_types",
"tasks_summary",
"test_sms_url_endpoint",
"update_config",
"update_huya_workbench_accounts",
"ws_huya_logs",
]