feat: 新增邮箱注册

This commit is contained in:
何嘉悦
2025-06-03 17:52:42 +08:00
parent 67f6bad76b
commit cf1ee9cbb0
9 changed files with 305 additions and 22 deletions
+7 -1
View File
@@ -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);
+28
View File
@@ -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;
}