验证码修改
This commit is contained in:
@@ -61,20 +61,22 @@ export const authApi = {
|
||||
/**
|
||||
* 发送手机验证码
|
||||
* @param phone 手机号
|
||||
* @returns Promise<ResultDomain<{sessionId: string, message: string}>>
|
||||
* @param scene 业务场景(login-登录, register-注册, reset-找回密码, bind-绑定手机等)
|
||||
* @returns Promise<ResultDomain<{sessionId: string, expireTime: string, message: string}>>
|
||||
*/
|
||||
async sendSmsCode(phone: string): Promise<ResultDomain<{sessionId: string, message: string}>> {
|
||||
const response = await api.post<{sessionId: string, message: string}>('/auth/send-sms-code', { phone });
|
||||
async sendSmsCode(phone: string, scene: string = 'default'): Promise<ResultDomain<{sessionId: string, expireTime: string, message: string}>> {
|
||||
const response = await api.post<{sessionId: string, expireTime: string, message: string}>('/auth/send-sms-code', { phone, scene });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 发送邮箱验证码
|
||||
* @param email 邮箱
|
||||
* @returns Promise<ResultDomain<{sessionId: string, message: string}>>
|
||||
* @param scene 业务场景(login-登录, register-注册, reset-找回密码, bind-绑定邮箱等)
|
||||
* @returns Promise<ResultDomain<{sessionId: string, expireTime: string, message: string}>>
|
||||
*/
|
||||
async sendEmailCode(email: string): Promise<ResultDomain<{sessionId: string, message: string}>> {
|
||||
const response = await api.post<{sessionId: string, message: string}>('/auth/send-email-code', { email });
|
||||
async sendEmailCode(email: string, scene: string = 'default'): Promise<ResultDomain<{sessionId: string, expireTime: string, message: string}>> {
|
||||
const response = await api.post<{sessionId: string, expireTime: string, message: string}>('/auth/send-email-code', { email, scene });
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user