feat: support user management

- sign up and delete account with email or phone
- sign in and sign out
- update nickname and avatar
- update account phone or email
This commit is contained in:
2025-11-18 20:53:08 +08:00
parent 83f8091e15
commit c923244a68
17 changed files with 982 additions and 40 deletions

View File

@@ -61,4 +61,53 @@ export interface PaginatedResponse<T> {
total: number;
limit: number;
offset: number;
}
// 用户相关类型
export interface SendCodeRequest {
target_type: 'phone' | 'email';
target: string;
scene: 'register' | 'update';
}
export interface RegisterRequest {
nickname?: string;
avatar_link?: string;
email?: string;
phone?: string;
password: string;
code: string;
}
export interface LoginRequest {
email?: string;
phone?: string;
password: string;
}
export interface User {
id: string;
phone?: string;
email?: string;
created_at: string;
nickname: string;
avatar_link?: string;
}
export interface UpdateUserRequest {
nickname?: string;
avatar_link?: string;
phone?: string;
email?: string;
}
export interface UpdatePhoneRequest {
phone: string;
code: string;
}
export interface UpdateEmailRequest {
email: string;
code: string;
}