Files
one-pipe-system/src/api/usersApi.ts
sexygoat 222e5bb11a Initial commit: One Pipe System
完整的管理系统,包含账户管理、卡片管理、套餐管理、财务管理等功能模块。

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-22 16:35:33 +08:00

40 lines
752 B
TypeScript

import request from '@/utils/http'
import { BaseResponse, UserInfoResponse } from '@/types/api'
interface LoginParams {
username: string
password: string
device?: string
}
interface UserListParams {
current?: number
size?: number
}
export class UserService {
// 登录
static login(params: LoginParams) {
return request.post<BaseResponse>({
url: '/api/admin/login',
params
})
}
// 获取用户信息
// GET /api/admin/me
static getUserInfo() {
return request.get<BaseResponse<UserInfoResponse>>({
url: '/api/admin/me'
})
}
// 获取用户列表
static getUserList(params?: UserListParams) {
return request.get<BaseResponse>({
url: '/api/user/list',
params
})
}
}