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
+7 -7
View File
@@ -1,20 +1,20 @@
/**
* 所有服务端接口的统一响应结构
* 前端调用 /api/* 时收到的永远是这个格式
* 所有服务端接口的统一响应结构
* 前端调用 /api/* 时统一接收这个格式
*/
export interface ApiResponse<T = any> {
export interface ICommonResponse<T = any> {
/** 业务状态码:0 = 成功,其他值为对应错误码 */
code: number;
/** 响应数据:成功时为实际数据,无数据或失败时为 null */
data: T | null;
/** 提示信息:成功时默认 "请求成功",失败时为错误原因描述 */
/** 提示信息:成功或失败时展示给前端的文案 */
msg: string;
}
/** 语义化的成功响应类型,code 固定为字面量 0,便于类型收窄 */
export type SuccessResponse<T = any> = ApiResponse<T> & { code: 0 };
export type ISuccessResponse<T = any> = ICommonResponse<T> & { code: 0 };
/** 语义化的错误响应类型data 固定为 null */
export type ErrorResponse = ApiResponse<null> & { code: number };
/** 语义化的错误响应类型 */
export type IErrorResponse = ICommonResponse<null> & { code: number };
export * from "./user";