收敛半自动平台为登录获取 CK 流程
移除角色绑定对客户页、状态展示和完成门禁的阻塞;虎牙与微博统一保存并直接导出 CK;同步精简客服工作台、配置项和权威文档。
This commit is contained in:
@@ -45,6 +45,44 @@ test('创建登录会话按真实 Connector 协议发送蛇形字段', async ()
|
||||
}
|
||||
})
|
||||
|
||||
test('外部虎牙 Connector 支持导出账号级 CK', async () => {
|
||||
const originalFetch = globalThis.fetch
|
||||
let requestUrl = ''
|
||||
globalThis.fetch = (async (url: string | URL | Request) => {
|
||||
requestUrl = String(url)
|
||||
return new Response(
|
||||
JSON.stringify({
|
||||
platformUid: '1686664168',
|
||||
nickname: '外部虎牙账号',
|
||||
cookies: [
|
||||
{
|
||||
name: 'udb_cred',
|
||||
value: 'external-cred',
|
||||
domain: '.huya.com',
|
||||
path: '/',
|
||||
secure: true,
|
||||
httpOnly: true,
|
||||
hostOnly: false,
|
||||
expiresAt: null,
|
||||
},
|
||||
],
|
||||
}),
|
||||
{ status: 200, headers: { 'Content-Type': 'application/json' } },
|
||||
)
|
||||
}) as typeof fetch
|
||||
try {
|
||||
const credential = await connector.exportHuyaSessionCredential('session-1', 'external')
|
||||
assert.equal(
|
||||
requestUrl,
|
||||
'http://connector.test/api/internal/huya-semi-auto/sessions/session-1/credential',
|
||||
)
|
||||
assert.equal(credential.platformUid, '1686664168')
|
||||
assert.equal(credential.cookies[0]?.value, 'external-cred')
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch
|
||||
}
|
||||
})
|
||||
|
||||
test('重新扫码换绑会向 Connector 传递 force_rebind', async () => {
|
||||
const originalFetch = globalThis.fetch
|
||||
let requestBody: Record<string, unknown> = {}
|
||||
|
||||
Reference in New Issue
Block a user