feat(semi-auto): 支持微博半自动履约与手机号国家码登录
新增微博内置 Connector:扫码/短信登录、Cookie 获取与一次性浏览器票据;客户页支持国家码选择、短信/扫码登录及登录即授权;dev-mock 与后台任务页适配微博 Mock 单。
This commit is contained in:
@@ -54,3 +54,49 @@ export function confirmCustomerBinding(orderNo: string, taskId: number) {
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export type CustomerWeiboCountryCode = {
|
||||
code: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export function fetchCustomerWeiboCountryCodes(orderNo: string, taskId: number) {
|
||||
return apiGet<{ countryCodes: CustomerWeiboCountryCode[] }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/weibo/config`,
|
||||
)
|
||||
}
|
||||
|
||||
export function sendCustomerWeiboSmsCode(
|
||||
orderNo: string,
|
||||
taskId: number,
|
||||
mobile: string,
|
||||
countryCode: string,
|
||||
) {
|
||||
return apiPost<{ ok: boolean; message: string }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/weibo/sms/send`,
|
||||
{ mobile, countryCode },
|
||||
)
|
||||
}
|
||||
|
||||
export function loginCustomerWeiboSms(
|
||||
orderNo: string,
|
||||
taskId: number,
|
||||
input: { mobile: string; code: string; countryCode: string },
|
||||
) {
|
||||
return apiPost<{ task: CustomerSemiAutoTask; login: CustomerLoginInfo }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/weibo/sms/login`,
|
||||
input,
|
||||
)
|
||||
}
|
||||
|
||||
export function startCustomerWeiboQrLogin(orderNo: string, taskId: number) {
|
||||
return apiGet<{ task: CustomerSemiAutoTask; login: CustomerLoginInfo }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/weibo/qrcode`,
|
||||
)
|
||||
}
|
||||
|
||||
export function pollCustomerWeiboQrLogin(orderNo: string, taskId: number) {
|
||||
return apiGet<{ task: CustomerSemiAutoTask; login: CustomerLoginInfo | null }>(
|
||||
`/api/v1/customer-fulfillment/${encodeURIComponent(orderNo)}/tasks/${taskId}/weibo/qrcode/status`,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user