调整(微博绑定): 确认后同样引导截图联系客服,换绑冷却按平台天数并留证
- 客户页抽出统一的「绑定已确认」渲染:标题 + 「请截图本页,把订单号和这张截图发给客服」+ 可复制订单号;虎牙与微博共用同一段文案,删除微博原来的「客服正在安排 / 请耐心等待」。 - 微博换绑冷却:天数只取后端 `rebindCooldownDays`(来自平台 `rebind_remain_days`); 冷却中且已有绑定角色时禁用「微信绑定 / QQ 绑定」并提示剩余天数, 「刷新角色状态」不受影响。 - 微博绑定失败原因改为常驻展示(平台原因 + 任务 lastError 去重), 冷却拒绝不再只弹一个瞬时 toast。 - 后端补留证:微博换绑被平台冷却拒绝时写 `last_error` 并追加 `weibo_binding_rejected` 事件(channel + 原因),便于客服排障。 - 权威文档补微博第 ⑥ 条:冷却天数只认平台、拒绝需留证、确认后直接引导截图联系客服。 - 测试:新增微博冷却与共用渲染断言(前端 491 全绿),后端补微博留证回归断言(1552 全绿)。
This commit is contained in:
@@ -634,10 +634,29 @@ export async function startPublicBinding(
|
||||
}
|
||||
assertCustomerProfileReady(task)
|
||||
if (task.platform === 'weibo') {
|
||||
const session = await startWeiboBinding(task.connector_session_id, task.connector_mode, {
|
||||
channel: input.channel === 'qq' ? 'qq' : 'wx',
|
||||
forceRebind: input.forceRebind === true,
|
||||
})
|
||||
let session: ConnectorBindingSession
|
||||
try {
|
||||
session = await startWeiboBinding(task.connector_session_id, task.connector_mode, {
|
||||
channel: input.channel === 'qq' ? 'qq' : 'wx',
|
||||
forceRebind: input.forceRebind === true,
|
||||
})
|
||||
} catch (error) {
|
||||
// 微博换绑被平台冷却拒绝时同样要留证:客户页要看到天数,后台要能看到原因。
|
||||
const message = error instanceof Error ? error.message : '生成微博角色绑定二维码失败'
|
||||
await withTransaction(async (client) => {
|
||||
const current = await loadTaskForUpdateWithClient(client, task.id)
|
||||
await convergeSemiAutoTaskState(client, current.id, {
|
||||
reason: 'weibo_binding_rejected',
|
||||
actor: 'customer',
|
||||
patch: { lastError: message },
|
||||
event: {
|
||||
eventType: 'weibo_binding_rejected',
|
||||
detail: { message, channel: input.channel === 'qq' ? 'qq' : 'wx' },
|
||||
},
|
||||
})
|
||||
})
|
||||
throw error
|
||||
}
|
||||
const binding = await updateBindingTask(task, session, 'customer')
|
||||
const updated = await loadTask(task.id)
|
||||
return { task: mapTask(updated), binding }
|
||||
|
||||
@@ -43,3 +43,14 @@ describe('改完资料后重新从平台核对一次绑定事实', () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('微博换绑被拒绝也要留证', () => {
|
||||
it('startPublicBinding 的微博分支会写 last_error 与事件', () => {
|
||||
const start = customerService.indexOf("if (task.platform === 'weibo') {\n let session")
|
||||
assert.ok(start > 0, '未找到微博分支的失败留证代码')
|
||||
const body = customerService.slice(start, start + 1600)
|
||||
assert.ok(body.includes("reason: 'weibo_binding_rejected'"))
|
||||
assert.ok(body.includes('patch: { lastError: message }'))
|
||||
assert.ok(body.includes("eventType: 'weibo_binding_rejected'"))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user