重构(斗鱼绑定): 统一角色候选判定与精英宝典查询

This commit is contained in:
yml
2026-11-26 09:14:38 +08:00
parent 244b556800
commit 91e4f5d33a
7 changed files with 470 additions and 175 deletions
@@ -209,10 +209,6 @@ def build_binding_evidence(
pending_role = pending_binding_role_from_result(result)
legacy_role = _text((legacy_latest or {}).get("roleName"))
action_alias_has_role = any(
item["alias"] in action_aliases and item["roleName"]
for item in candidates
)
account_current_role = _text(account.game_name) if account is not None else ""
# scannedRole 只认“本次新扫码”:
# - 新 pending(QYOOB bindAct=0 / 可确认角色);
@@ -232,8 +228,6 @@ def build_binding_evidence(
and _text(action_current.get("roleName")) == account_current_role
):
scanned_role = account_current_role
if not scanned_role and not action_alias_has_role:
scanned_role = legacy_role
# 取消 QYOOB-only 门禁后,cjm 的新角色同样可以成为客户确认目标;
# 这里展示真实本次扫码角色,避免详情说“不可确认”但客户页可以确认。
target_role = scanned_role