feat: 大部分注册登录功能

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-24 18:02:42 +08:00
parent 5ab74ad9dd
commit 5294528148
23 changed files with 858 additions and 167 deletions
+28 -18
View File
@@ -1,33 +1,31 @@
/**
* 用户注册请求体
* 对应 NewAPI POST /api/user/register 接口
* 所有字段均为可选,上游接口本身不强制任何字段
* 用户注册请求体
* 对应 NewAPI POST /api/user/register 接口
*/
export interface UserRegisterRequest {
export interface IUserRegisterRequest {
/** 用户名 */
username?: string;
/** 登录密码 */
password?: string;
/** 邮箱地址 */
email?: string;
/** 邮箱验证码注册时若开启邮箱验证则需要填写 */
/** 邮箱验证码注册时若开启邮箱验证则需要填写 */
verification_code?: string;
/** 推广码 / 邀请码 */
aff_code?: string;
}
/**
* 注册成功时上游接口返回的数据类型
* NewAPI 注册接口成功时直接返回字符串 "成功"
* 注册成功时上游接口返回的数据类型
* NewAPI 注册接口成功时通常直接返回字符串
*/
export type UserRegisterResult = string;
export type IUserRegisterData = string;
/**
* 用户登录请求体
* 对应 NewAPI POST /api/user/login 接口
* 所有字段均为可选,上游接口本身不强制任何字段
* 用户登录请求体
* 对应 NewAPI POST /api/user/login 接口
*/
export interface UserLoginRequest {
export interface IUserLoginRequest {
/** 用户名 */
username?: string;
/** 登录密码 */
@@ -35,13 +33,25 @@ export interface UserLoginRequest {
}
/**
* 登录成功时上游接口返回的数据类型
* NewAPI 登录接口成功时响应体为空,此处用 null 表示
* 登录成功后返回的用户信息。
*/
export type UserLoginResult = null;
export interface IUserLoginData {
/** 用户 ID */
id: number;
/** 用户名 */
username: string;
/** 展示名称 */
display_name: string;
/** 用户分组 */
group: string;
/** 用户角色 */
role: number;
/** 用户状态 */
status: number;
}
/**
* 登出成功时上游接口返回的数据类型
* NewAPI 登出接口通常无业务数据返回,此处用 null 表示
* 登出成功时上游接口返回的数据类型
* NewAPI 登出接口通常无业务数据返回,此处用 null 表示
*/
export type UserLogoutResult = null;
export type IUserLogoutData = null;