feat(半自动履约): 补齐微博游戏角色绑定流程

This commit is contained in:
yml
2026-11-18 15:45:13 +08:00
parent f76b9c452d
commit 623a4ffa05
21 changed files with 1366 additions and 156 deletions
@@ -0,0 +1,66 @@
export type AccountBindingPlatform = 'huya' | 'douyu' | 'weibo'
export type AccountBindingQueryOwner = 'order_site' | 'live_hub'
export type AccountBindingKind = 'game_role' | 'account_authorization'
export type AccountBindingField = 'roleName' | 'roleId' | 'serverZone' | 'loginChannel'
export type AccountBindingConfirmationMode = 'customer_match' | 'platform_verified'
export type AccountBindingRebindMode = 'platform_confirm' | 'rescan_qr'
export type AccountBindingPolicy = {
platform: AccountBindingPlatform
platformLabel: string
bindingKind: AccountBindingKind
bindingRequired: boolean
requiresCustomerProfile: boolean
supportsRebind: boolean
queryOwner: AccountBindingQueryOwner
requiredFields: readonly AccountBindingField[]
confirmationMode: AccountBindingConfirmationMode
rebindMode: AccountBindingRebindMode
defaultTargetUrl: string
}
const POLICIES: Record<AccountBindingPlatform, AccountBindingPolicy> = {
huya: {
platform: 'huya',
platformLabel: '虎牙',
bindingKind: 'game_role',
bindingRequired: true,
requiresCustomerProfile: true,
supportsRebind: true,
queryOwner: 'order_site',
requiredFields: ['roleName', 'roleId', 'serverZone'],
confirmationMode: 'customer_match',
rebindMode: 'platform_confirm',
defaultTargetUrl: 'https://www.huya.com/',
},
douyu: {
platform: 'douyu',
platformLabel: '斗鱼',
bindingKind: 'game_role',
bindingRequired: true,
requiresCustomerProfile: true,
supportsRebind: true,
queryOwner: 'live_hub',
requiredFields: ['roleName', 'serverZone'],
confirmationMode: 'customer_match',
rebindMode: 'platform_confirm',
defaultTargetUrl: 'https://www.douyu.com/',
},
weibo: {
platform: 'weibo',
platformLabel: '微博',
bindingKind: 'game_role',
bindingRequired: true,
requiresCustomerProfile: false,
supportsRebind: true,
queryOwner: 'order_site',
requiredFields: ['roleName'],
confirmationMode: 'platform_verified',
rebindMode: 'rescan_qr',
defaultTargetUrl: 'https://weibo.com/',
},
}
export function getAccountBindingPolicy(platform: AccountBindingPlatform) {
return POLICIES[platform]
}