调整(半自动注入): 虎牙默认跳转页收敛到精英宝典积分中心(由公共策略声明)
- platform-policy 的 defaultTargetUrl 改为注入浏览器的权威默认落地页: 虎牙 = m-shop.huya.com 精英宝典积分中心,微博 = vipclub 游戏中心 (与原有前端常量一致,避免优先级变化改变微博行为)。 - mapTask 的 bindingPolicy 增加 defaultTargetUrl,前端不再各自硬编码跳转口径。 - 前端新增 resolveInjectionTargetUrl 并导出,优先级为 人工 SKU browserTargets → 后端策略 → 前端兜底常量;补对应单测。 - 平台请求使用的 Referer/Origin 保持 www.huya.com 不变,跳转落地页与请求身份是两件事。
This commit is contained in:
@@ -26,6 +26,21 @@ test('平台能力声明统一描述角色查询、确认与换绑方式', () =>
|
||||
assert.deepEqual(weibo.requiredFields, ['roleName'])
|
||||
})
|
||||
|
||||
test('注入浏览器的默认落地页由公共策略声明,虎牙固定为精英宝典积分中心', () => {
|
||||
const huya = getAccountBindingPolicy('huya')
|
||||
assert.equal(
|
||||
huya.defaultTargetUrl,
|
||||
'https://m-shop.huya.com/points.html?pagecode=heping_baodian_credit_center_page' +
|
||||
'&sourceId=yellowcarlist&pid=1199650619883&anchorUid=1199650619883&roomid=30596253',
|
||||
)
|
||||
assert.equal(
|
||||
getAccountBindingPolicy('weibo').defaultTargetUrl,
|
||||
'https://vipclub.e.weibo.com/game/homepage?F=bowen_tjg',
|
||||
)
|
||||
// 平台请求的 Referer/Origin 与跳转落地页是两件事,不能被这里的变化带偏。
|
||||
assert.notEqual(getAccountBindingPolicy('douyu').defaultTargetUrl, huya.defaultTargetUrl)
|
||||
})
|
||||
|
||||
test('区服规范化为同一口径', () => {
|
||||
assert.equal(resolveServerZone('苹果(iOS) · QQ'), '苹果Q区')
|
||||
assert.equal(resolveServerZone('微信 安卓(android)'), '安卓V区')
|
||||
|
||||
@@ -32,7 +32,10 @@ const POLICIES: Record<AccountBindingPlatform, AccountBindingPolicy> = {
|
||||
requiredFields: ['roleName', 'serverZone'],
|
||||
confirmationMode: 'customer_match',
|
||||
rebindMode: 'platform_confirm',
|
||||
defaultTargetUrl: 'https://www.huya.com/',
|
||||
// 虎牙「注入浏览器」默认落地页:精英宝典积分中心(后台兑换入口)。
|
||||
// 这是跳转目标,不参与任何平台请求的 Referer/Origin。
|
||||
defaultTargetUrl:
|
||||
'https://m-shop.huya.com/points.html?pagecode=heping_baodian_credit_center_page&sourceId=yellowcarlist&pid=1199650619883&anchorUid=1199650619883&roomid=30596253',
|
||||
},
|
||||
douyu: {
|
||||
platform: 'douyu',
|
||||
@@ -58,7 +61,8 @@ const POLICIES: Record<AccountBindingPlatform, AccountBindingPolicy> = {
|
||||
requiredFields: ['roleName'],
|
||||
confirmationMode: 'platform_verified',
|
||||
rebindMode: 'rescan_qr',
|
||||
defaultTargetUrl: 'https://weibo.com/',
|
||||
// 微博「注入浏览器」默认落地页:游戏中心(后台兑换入口)。
|
||||
defaultTargetUrl: 'https://vipclub.e.weibo.com/game/homepage?F=bowen_tjg',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -516,6 +516,8 @@ export function mapTask(task: TaskRow) {
|
||||
requiredFields: bindingPolicy.requiredFields,
|
||||
confirmationMode: bindingPolicy.confirmationMode,
|
||||
rebindMode: bindingPolicy.rebindMode,
|
||||
// 注入浏览器的默认落地页由公共策略声明,前端不再各自硬编码。
|
||||
defaultTargetUrl: bindingPolicy.defaultTargetUrl,
|
||||
},
|
||||
loginStatus: task.login_status,
|
||||
bindingStatus: task.binding_status,
|
||||
|
||||
Reference in New Issue
Block a user