feat(semi-auto): 支持微博半自动履约与手机号国家码登录

新增微博内置 Connector:扫码/短信登录、Cookie 获取与一次性浏览器票据;客户页支持国家码选择、短信/扫码登录及登录即授权;dev-mock 与后台任务页适配微博 Mock 单。
This commit is contained in:
2026-11-10 19:05:05 +08:00
parent 08c3834a1c
commit 90173e3bd7
11 changed files with 1980 additions and 138 deletions
@@ -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`,
)
}