feat: 新增邮箱注册
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import type { LoginDTO, LoginVO } from './types';
|
||||
import type { EmailCodeDTO, LoginDTO, LoginVO, RegisterDTO } from './types';
|
||||
import { post } from '@/utils/request';
|
||||
|
||||
export const login = (data: LoginDTO) => post<LoginVO>('/auth/login', data);
|
||||
|
||||
// 邮箱验证码
|
||||
export const emailCode = (data: EmailCodeDTO) => post('/resource/email/code', data);
|
||||
|
||||
// 注册账号
|
||||
export const register = (data: RegisterDTO) => post('/auth/register', data);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
export interface LoginDTO {
|
||||
username: string;
|
||||
password: string;
|
||||
code?: string;
|
||||
// 二次确认密码
|
||||
confirmPassword?: string;
|
||||
}
|
||||
|
||||
export interface LoginVO {
|
||||
@@ -116,3 +119,28 @@ export interface RoleDTO {
|
||||
*/
|
||||
roleName?: string;
|
||||
}
|
||||
|
||||
// 邮箱验证码
|
||||
export interface EmailCodeDTO {
|
||||
username?: string;
|
||||
}
|
||||
|
||||
// 邮箱注册
|
||||
export interface RegisterDTO {
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
username: string;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
password: string;
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* 确认密码
|
||||
*/
|
||||
confirmPassword?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user