完善虎牙短信登录与图形安全验证
This commit is contained in:
@@ -27,6 +27,76 @@ export function pollCustomerLogin(orderNo: string, taskId: number) {
|
||||
)
|
||||
}
|
||||
|
||||
type CustomerHuyaChallengeBase = {
|
||||
image: string
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export type CustomerHuyaSmsChallenge =
|
||||
| (CustomerHuyaChallengeBase & {
|
||||
type: 'slider'
|
||||
puzzleImage: string
|
||||
puzzleWidth: number
|
||||
puzzleY: number
|
||||
})
|
||||
| (CustomerHuyaChallengeBase & {
|
||||
type: 'rotate'
|
||||
puzzleImage: string
|
||||
puzzleWidth: number
|
||||
puzzleHeight: number
|
||||
puzzleX: number
|
||||
puzzleY: number
|
||||
})
|
||||
| (CustomerHuyaChallengeBase & {
|
||||
type: 'click'
|
||||
tipImage: string
|
||||
question: string
|
||||
wordSize: number
|
||||
})
|
||||
|
||||
export type CustomerHuyaChallengeSolution = {
|
||||
distance?: number
|
||||
angle?: number
|
||||
points?: Array<{ x: number; y: number }>
|
||||
}
|
||||
|
||||
export type CustomerHuyaSmsSendResult = {
|
||||
ok: boolean
|
||||
message: string
|
||||
expiresAt: string
|
||||
challenge: CustomerHuyaSmsChallenge | null
|
||||
}
|
||||
|
||||
export function sendCustomerHuyaSmsCode(orderNo: string, taskId: number, mobile: string) {
|
||||
return apiPost<CustomerHuyaSmsSendResult>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/huya/sms/send`,
|
||||
{ mobile },
|
||||
)
|
||||
}
|
||||
|
||||
export function verifyCustomerHuyaSmsChallenge(
|
||||
orderNo: string,
|
||||
taskId: number,
|
||||
solution: CustomerHuyaChallengeSolution,
|
||||
) {
|
||||
return apiPost<CustomerHuyaSmsSendResult>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/huya/sms/verify`,
|
||||
solution,
|
||||
)
|
||||
}
|
||||
|
||||
export function loginCustomerHuyaSms(
|
||||
orderNo: string,
|
||||
taskId: number,
|
||||
input: { mobile: string; code: string },
|
||||
) {
|
||||
return apiPost<{ task: CustomerSemiAutoTask; login: CustomerLoginInfo }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/huya/sms/login`,
|
||||
input,
|
||||
)
|
||||
}
|
||||
|
||||
export type CustomerWeiboCountryCode = {
|
||||
code: string
|
||||
name: string
|
||||
|
||||
Reference in New Issue
Block a user