feat(claim): 配合方案B支持买家纠错扫码UID自愈绑定,自建页面增加确认更换提示与快捷填入

This commit is contained in:
yml2213
2026-10-06 11:12:18 +08:00
parent af6dc27017
commit 2a0eea40e9
3 changed files with 181 additions and 7 deletions
@@ -7,6 +7,8 @@ import {
canReuseAffiliateDashBindSnapshot,
isAffiliateDashBindSnapshotStale,
isAffiliateDashSnapshotFresh,
isRockAffiliateDashSku,
shouldRefuseRockRebind,
shouldRefreshAffiliateDashBindStateForSnapshot,
} from './kuaishou-cloud-claim-service.js'
@@ -123,6 +125,81 @@ test('canReuseAffiliateDashBindSnapshot reuses verified matching bound account',
)
})
test('rock rebind is refused after mismatch or after a successful bind changes uid', () => {
assert.equal(isRockAffiliateDashSku('rock_black_tshirt'), true)
assert.equal(isRockAffiliateDashSku('top_black_elite_trainer'), false)
assert.equal(
shouldRefuseRockRebind({
sku: 'rock_black_tshirt',
bindUuid: 'bind-1',
bindMismatch: true,
}),
true,
)
// 方案 B:买家改回扫码真实账号时放行自愈,改第三个账号时拒绝
assert.equal(
shouldRefuseRockRebind(
{
sku: 'rock_black_tshirt',
bindUuid: 'bind-1',
boundAccount: '3454648872',
bindMismatch: true,
},
'3454648872',
),
false,
)
assert.equal(
shouldRefuseRockRebind(
{
sku: 'rock_black_tshirt',
bindUuid: 'bind-1',
boundAccount: '3454648872',
bindMismatch: true,
},
'9999999999',
),
true,
)
assert.equal(
shouldRefuseRockRebind(
{
sku: 'rock_black_tshirt',
bindUuid: 'bind-1',
bound: true,
boundAccount: '111',
expectedGameAccount: '111',
},
'222',
),
true,
)
assert.equal(
shouldRefuseRockRebind(
{
sku: 'rock_black_tshirt',
bindUuid: 'bind-1',
bound: false,
bindMismatch: false,
expectedGameAccount: '111',
},
'222',
),
false,
)
assert.equal(
shouldRefuseRockRebind(
{
sku: 'skin_other',
bindUuid: 'bind-1',
bindMismatch: true,
},
'222',
),
false,
)
})
test('canReuseAffiliateDashBindSnapshot refuses mismatched bound account', () => {
assert.equal(
canReuseAffiliateDashBindSnapshot(