修复(履约绑定): 匹配客户目标时展示 cjm 待确认角色
This commit is contained in:
@@ -559,16 +559,22 @@ def pending_binding_role_from_result(result: dict[str, Any] | None) -> str:
|
||||
in action_alias_set
|
||||
and str(item.get("role_name") or "").strip()
|
||||
]
|
||||
expected_role_name = str(result.get("expected_role_name") or "").strip()
|
||||
expected_matches = bool(
|
||||
expected_role_name
|
||||
and role_name.casefold() == expected_role_name.casefold()
|
||||
)
|
||||
if (
|
||||
action_alias_set
|
||||
and selected_alias
|
||||
and selected_alias not in action_alias_set
|
||||
and action_evidence
|
||||
and not expected_matches
|
||||
):
|
||||
# legacy(cjm) 可能返回同一斗鱼账号历史绑过的另一个游戏角色。
|
||||
# 动作 alias 仍有明确角色时,legacy 的 role_name 不能成为本单 pending。
|
||||
# 动作 alias 仍有明确角色时,只有与客户目标一致的 legacy 角色可以进入
|
||||
# pending;不匹配的历史角色不能覆盖本单。
|
||||
return ""
|
||||
expected_role_name = str(result.get("expected_role_name") or "").strip()
|
||||
if is_pending_binding_role(
|
||||
result,
|
||||
baseline_role_name=baseline,
|
||||
|
||||
@@ -382,7 +382,16 @@ class BindMixin:
|
||||
for info, decision in zip(candidates, decisions, strict=True):
|
||||
alias = str(info.get("act_alias") or "").strip()
|
||||
role_name = str(info.get("role_name") or "").strip()
|
||||
if alias not in alias_set and role_name not in action_roles:
|
||||
expected_matches = bool(
|
||||
expected_role_name
|
||||
and role_name.casefold()
|
||||
== expected_role_name.strip().casefold()
|
||||
)
|
||||
if (
|
||||
alias not in alias_set
|
||||
and role_name not in action_roles
|
||||
and not expected_matches
|
||||
):
|
||||
decision.update(
|
||||
{
|
||||
"confirmable": False,
|
||||
@@ -714,7 +723,14 @@ class BindMixin:
|
||||
if not role_name or role_name.casefold() == baseline:
|
||||
continue
|
||||
alias = str(info.get("act_alias") or "").strip()
|
||||
if action_alias_has_role and alias not in alias_set:
|
||||
expected_matches = bool(
|
||||
expected and role_name.casefold() == expected
|
||||
)
|
||||
if (
|
||||
action_alias_has_role
|
||||
and alias not in alias_set
|
||||
and not expected_matches
|
||||
):
|
||||
continue
|
||||
if expected and role_name.casefold() != expected:
|
||||
continue
|
||||
@@ -730,7 +746,14 @@ class BindMixin:
|
||||
for info in ordered:
|
||||
role_name = str(info.get("role_name") or "").strip()
|
||||
alias = str(info.get("act_alias") or "").strip()
|
||||
if action_alias_has_role and alias not in alias_set:
|
||||
expected_matches = bool(
|
||||
expected and role_name.casefold() == expected
|
||||
)
|
||||
if (
|
||||
action_alias_has_role
|
||||
and alias not in alias_set
|
||||
and not expected_matches
|
||||
):
|
||||
continue
|
||||
if expected and role_name.casefold() != expected:
|
||||
continue
|
||||
|
||||
@@ -1398,22 +1398,28 @@ export default function PlatformFulfillmentPage() {
|
||||
title: '用户角色绑定',
|
||||
key: 'binding',
|
||||
width: 180,
|
||||
render: (_, task) => (
|
||||
<Space direction="vertical" size={2}>
|
||||
<Tag color={bindingStatusColor(task.bindingStatus)}>
|
||||
{bindingStatusLabel(task.bindingStatus)}
|
||||
</Tag>
|
||||
{task.account && task.bindingStatus === 'failed' ? (
|
||||
<Tag color="orange">账号保留中</Tag>
|
||||
) : null}
|
||||
<Text>{task.bindTask?.roleName || (task.bindTask?.bindPhase === 'role_ready' ? '角色待确认' : '-')}</Text>
|
||||
{task.bindingStatus === 'bound' ? (
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
换绑时间:{formatTime(task.account?.roleChangeAvailableAt) || '无冷却'}
|
||||
</Text>
|
||||
) : null}
|
||||
</Space>
|
||||
),
|
||||
render: (_, task) => {
|
||||
const roleName =
|
||||
task.bindTask?.roleName?.trim() ||
|
||||
task.customerProfile?.roleName?.trim() ||
|
||||
'-';
|
||||
return (
|
||||
<Space direction="vertical" size={2}>
|
||||
<Tag color={bindingStatusColor(task.bindingStatus)}>
|
||||
{bindingStatusLabel(task.bindingStatus)}
|
||||
</Tag>
|
||||
{task.account && task.bindingStatus === 'failed' ? (
|
||||
<Tag color="orange">账号保留中</Tag>
|
||||
) : null}
|
||||
<Text ellipsis title={roleName}>{roleName}</Text>
|
||||
{task.bindingStatus === 'bound' ? (
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
换绑时间:{formatTime(task.account?.roleChangeAvailableAt) || '无冷却'}
|
||||
</Text>
|
||||
) : null}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '游戏主页',
|
||||
|
||||
Reference in New Issue
Block a user