This commit is contained in:
ryan
2026-06-08 08:19:22 +08:00
parent 4b72419a96
commit 9d0f9f0576
42 changed files with 1412 additions and 809 deletions
@@ -1,6 +1,7 @@
import {BaseService} from '../core/base.service';
import type {
AuthSource,
ChangePasswordRequest,
ExternalAccountBinding,
LoginRequest,
OAuthAuthorizeResponse,
@@ -110,6 +111,10 @@ export class AuthService extends BaseService {
return this.post<User>('/user/register', request);
}
static async changePassword(request: ChangePasswordRequest): Promise<void> {
return this.post<void>('/user/change-password', request);
}
static async getExternalAccountBindings(): Promise<ExternalAccountBinding[]> {
return this.get<ExternalAccountBinding[]>('/oauth/external-accounts');
}
+1 -1
View File
@@ -26,7 +26,6 @@
*/
export { AuthService } from './auth.service';
export { TrustLevel, PayLevel } from './types';
export type {
User,
OAuthLoginUrlResponse,
@@ -37,4 +36,5 @@ export type {
OAuthCallbackResult,
AuthSource,
ExternalAccountBinding,
ChangePasswordRequest,
} from './types';
+7 -52
View File
@@ -1,33 +1,3 @@
/**
* 信任等级
*/
export enum TrustLevel {
/** 新用户 */
New = 0,
/** 基础用户 */
Basic = 1,
/** 成员 */
Member = 2,
/** 常规用户 */
Regular = 3,
/** 领导者 */
Leader = 4,
}
/**
* 支付等级
*/
export enum PayLevel {
/** 普通 */
Ordinary = 0,
/** 黄金 */
Gold = 1,
/** 白金 */
WhiteGold = 2,
/** 黑金 */
BlackGold = 3,
}
/**
* 用户基本信息
*/
@@ -38,32 +8,12 @@ export interface User {
username: string;
/** 昵称 */
nickname: string;
/** 信任等级 */
trust_level: TrustLevel;
/** 头像 URL */
avatar_url: string;
/** 总接收金额 */
total_receive: string;
/** 总支付金额 */
total_payment: string;
/** 总社区金额 */
total_community: string;
/** 社区余额 */
community_balance: string;
/** 可用余额 */
available_balance: string;
/** 在途资金(延迟到账中) */
pending_balance: string;
/** 支付分数 */
pay_score: number;
/** 是否为管理员 */
is_admin: boolean;
/** 当日剩余配额 */
remain_quota: string;
/** 支付等级 */
pay_level: PayLevel;
/** 每日限额 */
daily_limit: number | null;
/** 是否需要修改密码 */
need_change_password?: boolean;
}
/**
@@ -122,3 +72,8 @@ export interface ExternalAccountBinding {
email: string;
created_at: string;
}
export interface ChangePasswordRequest {
old_password: string;
new_password: string;
}