修复 affiliate-dash 提交前绑定校验
This commit is contained in:
@@ -437,35 +437,11 @@ export async function submitAffiliateDashClaim(
|
||||
const gameAccount = expectedGameAccount
|
||||
let latestFlow = flow
|
||||
|
||||
// 强制校验:绑定返回的游戏账号与第一步填写 UID 不一致时禁止提交(防止 uid 输错),
|
||||
// 不依赖请求体 UID,也不依赖平台 mismatch 字段,避免错绑后被前端或手动请求绕过。
|
||||
// 提交阶段不再实时调用 affiliate-dash bind-result。
|
||||
// 平台日志显示:正常流程在 submit 前额外触发一次 bind-result 后,delivery/submit 会在平台侧
|
||||
// bind_verify 阶段偶发/稳定返回“账号尚未绑定”。这里改为使用详情轮询已写入的本地绑定快照,
|
||||
// 避免 submit 前的额外平台查询改变或干扰平台发货校验链路。
|
||||
if (!isMock && flow.bindUuid) {
|
||||
try {
|
||||
const bindResult = await getAffiliateDashBindResult({
|
||||
orderNo: flow.orderNo,
|
||||
bindUuid,
|
||||
})
|
||||
const boundAccount = bindResult.gameAccount
|
||||
const bindMismatch =
|
||||
Boolean(bindResult.mismatch) ||
|
||||
Boolean(boundAccount && normalizeUid(boundAccount) !== normalizeUid(expectedGameAccount))
|
||||
latestFlow = {
|
||||
...flow,
|
||||
bound: bindResult.bound,
|
||||
boundAccount: boundAccount || flow.boundAccount,
|
||||
gameChannel: bindResult.gameChannel || flow.gameChannel,
|
||||
bindMismatch,
|
||||
}
|
||||
await updateTask(task.id, {
|
||||
context_json: JSON.stringify({
|
||||
...taskContext,
|
||||
affiliateDash: latestFlow,
|
||||
}),
|
||||
updated_at: now,
|
||||
})
|
||||
} catch {
|
||||
// 拉取失败:只能使用本地最近一次详情刷新结果,不能无校验放行。
|
||||
}
|
||||
const latestBoundAccount = latestFlow.boundAccount
|
||||
const latestMismatch =
|
||||
Boolean(latestFlow.bindMismatch) ||
|
||||
|
||||
Reference in New Issue
Block a user