feat(huya): 统一积分兑换并完善兑换记录

This commit is contained in:
yml
2026-11-13 19:03:55 +08:00
parent b89ee4fd18
commit 711be0e2b6
17 changed files with 2064 additions and 193 deletions
+13 -2
View File
@@ -31,10 +31,21 @@ def create_browser_exchange_kit(
raise HTTPException(status_code=400, detail="该账号没有可用 Cookie,请先登录")
config = ensure_huya_config(db)
room_pid = huya_config_value("room_pid", config.room_pid)
points_page_code = huya_config_value("points_page_code", config.points_page_code)
points_source_id = huya_config_value("points_source_id", config.points_source_id)
target = req.target if req and req.target else DEFAULT_EXCHANGE_TARGET
targets = exchange_target_options(room_pid)
targets = exchange_target_options(
room_pid,
points_page_code=points_page_code,
points_source_id=points_source_id,
)
try:
target_url = exchange_target_url(target, room_pid)
target_url = exchange_target_url(
target,
room_pid,
points_page_code=points_page_code,
points_source_id=points_source_id,
)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
pairs = dict(cookie_pairs(normalize_huya_cookie(account.cookie)))