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:
39
src/api/usersApi.ts
Normal file
39
src/api/usersApi.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user