移动端和 PC 端登录页都加了“图形验证码
This commit is contained in:
@@ -25,11 +25,24 @@ export interface LoginData {
|
||||
tokens: TokenPair
|
||||
}
|
||||
|
||||
export async function sendSmsCode(phone: string) {
|
||||
export interface AuthCaptcha {
|
||||
captcha_id: string
|
||||
image: string
|
||||
expires_in: number
|
||||
}
|
||||
|
||||
export async function fetchAuthCaptcha() {
|
||||
const { data } = await apiClient.get<ApiResponse<AuthCaptcha>>('/auth/captcha')
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function sendSmsCode(phone: string, captchaId: string, captchaCode: string) {
|
||||
const { data } = await apiClient.post<ApiResponse<{ phone: string; expires_in: number }>>(
|
||||
'/auth/sms/send',
|
||||
{
|
||||
phone,
|
||||
captcha_id: captchaId,
|
||||
captcha_code: captchaCode,
|
||||
}
|
||||
)
|
||||
return data.data
|
||||
|
||||
Reference in New Issue
Block a user