个人信息页面增强

This commit is contained in:
ryan
2026-06-08 19:38:53 +08:00
parent b96624a251
commit 0f65202659
22 changed files with 1568 additions and 370 deletions
@@ -9,6 +9,7 @@ import type {
OAuthCallbackResult,
OAuthLoginUrlResponse,
RegisterRequest,
UpdateProfileRequest,
User,
} from './types';
@@ -119,6 +120,10 @@ export class AuthService extends BaseService {
return this.post<void>('/user/change-password', request);
}
static async updateProfile(request: UpdateProfileRequest): Promise<User> {
return this.put<User>('/user/profile', request);
}
static async getExternalAccountBindings(): Promise<ExternalAccountBinding[]> {
return this.get<ExternalAccountBinding[]>('/oauth/external-accounts');
}
+1
View File
@@ -37,4 +37,5 @@ export type {
AuthSource,
ExternalAccountBinding,
ChangePasswordRequest,
UpdateProfileRequest,
} from './types';
+23
View File
@@ -14,6 +14,29 @@ export interface User {
is_admin: boolean;
/** 是否需要修改密码 */
need_change_password?: boolean;
/** 邮箱 */
email: string;
/** 个人简介 */
bio?: string;
/** 手机号码 */
phone?: string;
/** 性别 */
gender?: string;
/** 个人网站 */
website?: string;
/** 所在地 */
location?: string;
}
export interface UpdateProfileRequest {
nickname: string;
email: string;
avatar_url: string;
bio?: string;
phone?: string;
gender?: string;
website?: string;
location?: string;
}
/**
+2
View File
@@ -24,4 +24,6 @@ export interface PublicConfigResponse {
email_login_verification_enabled: boolean;
/** 是否启用邮箱注册验证 */
email_register_verification_enabled: boolean;
/** 目录显示配置 */
menu_display_config?: Record<string, boolean>;
}
+1 -1
View File
@@ -82,7 +82,7 @@ export type {
// 认证服务
export { AuthService } from './auth';
export type { User, OAuthLoginUrlResponse, OAuthCallbackRequest, AuthSource, ExternalAccountBinding, ChangePasswordRequest } from './auth';
export type { User, OAuthLoginUrlResponse, OAuthCallbackRequest, AuthSource, ExternalAccountBinding, ChangePasswordRequest, UpdateProfileRequest } from './auth';
// 配置服务
export { ConfigService } from './config';