完善虎牙已有绑定角色确认与重新扫码换绑流程
This commit is contained in:
@@ -38,6 +38,8 @@ export type ConnectorBindingSession = {
|
||||
bindGameAccount: string
|
||||
bindGameRole: string
|
||||
bindGameChannel: string
|
||||
hasExistingBinding?: boolean
|
||||
rebindRequested?: boolean
|
||||
message: string
|
||||
}
|
||||
|
||||
@@ -219,11 +221,17 @@ export async function getHuyaLoginSession(
|
||||
export async function startHuyaBinding(
|
||||
sessionId: string,
|
||||
mode: SemiAutoConnectorMode = defaultSemiAutoConnectorMode(),
|
||||
options: { forceRebind?: boolean } = {},
|
||||
): Promise<ConnectorBindingSession> {
|
||||
if (mode === 'embedded') return huyaNativeConnector.startBinding(sessionId)
|
||||
if (mode === 'embedded') {
|
||||
return huyaNativeConnector.startBinding(
|
||||
sessionId,
|
||||
options.forceRebind ? { forceRebind: true } : {},
|
||||
)
|
||||
}
|
||||
return callConnector<ConnectorBindingSession>(
|
||||
`/api/internal/huya-semi-auto/sessions/${encodeURIComponent(sessionId)}/binding`,
|
||||
{ method: 'POST', body: {} },
|
||||
{ method: 'POST', body: { force_rebind: Boolean(options.forceRebind) } },
|
||||
mode,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user