Initial commit: One Pipe System

完整的管理系统,包含账户管理、卡片管理、套餐管理、财务管理等功能模块。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sexygoat
2026-01-22 16:35:33 +08:00
commit 222e5bb11a
495 changed files with 145440 additions and 0 deletions

63
src/api/modules/auth.ts Normal file
View File

@@ -0,0 +1,63 @@
/**
* 认证相关 API
*/
import { BaseService } from '../BaseService'
import type {
LoginParams,
LoginData,
UserInfo,
UserInfoResponse,
RefreshTokenParams,
RefreshTokenData,
ChangePasswordParams,
BaseResponse
} from '@/types/api'
export class AuthService extends BaseService {
/**
* 用户登录
* @param params 登录参数
*/
static login(params: LoginParams): Promise<BaseResponse<LoginData>> {
return this.post<BaseResponse<LoginData>>('/api/admin/login', params)
}
/**
* 退出登录
*/
static logout(): Promise<BaseResponse> {
return this.post<BaseResponse>('/api/admin/logout')
}
/**
* 获取当前用户信息
* GET /api/admin/me
*/
static getUserInfo(): Promise<BaseResponse<UserInfoResponse>> {
return this.get<BaseResponse<UserInfoResponse>>('/api/admin/me')
}
/**
* 刷新 Token
* @param params 刷新参数
*/
static refreshToken(params: RefreshTokenParams): Promise<BaseResponse<RefreshTokenData>> {
return this.post<BaseResponse<RefreshTokenData>>('/api/auth/refresh', params)
}
/**
* 修改密码
* @param params 修改密码参数
*/
static changePassword(params: ChangePasswordParams): Promise<BaseResponse> {
return this.post<BaseResponse>('/api/auth/change-password', params)
}
/**
* 获取验证码(如果需要)
*/
static getCaptcha(): Promise<BaseResponse<{ captchaId: string; captchaImage: string }>> {
return this.get<BaseResponse<{ captchaId: string; captchaImage: string }>>('/api/auth/captcha')
}
}