mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
feat: 更新验证码逻辑,优化邮件验证功能,增加验证码冷却时间,改进用户体验Closes #17
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import type { OidcConfig } from '@/models/oidc-config'
|
||||
import type { BaseResponse } from '@/models/resp'
|
||||
import type { User } from '@/models/user'
|
||||
import { CaptchaProvider } from '@/models/captcha'
|
||||
import { CaptchaProvider } from '@/types/captcha'
|
||||
import axiosClient from './client'
|
||||
|
||||
export async function userLogin(
|
||||
@ -97,8 +97,8 @@ export async function updateUser(data: Partial<User>): Promise<BaseResponse<User
|
||||
return res.data
|
||||
}
|
||||
|
||||
export async function requestEmailVerifyCode(email: string): Promise<BaseResponse<{ coolDown: number }>> {
|
||||
const res = await axiosClient.post<BaseResponse<{ coolDown: number }>>('/user/email/verify', { email })
|
||||
export async function requestEmailVerifyCode({email, captchaToken}: {email: string, captchaToken?: string}): Promise<BaseResponse<{ coolDown: number }>> {
|
||||
const res = await axiosClient.post<BaseResponse<{ coolDown: number }>>('/user/email/verify', { email }, { headers: { 'X-Captcha-Token': captchaToken } })
|
||||
return res.data
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user