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:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user