新增答辩用后台管理系统
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { post, get } from '@/api/request'
|
||||
|
||||
export interface LoginParams {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
token: string
|
||||
userId: number
|
||||
username: string
|
||||
roles: string[]
|
||||
permissions: string[]
|
||||
}
|
||||
|
||||
export function login(params: LoginParams): Promise<AuthResponse> {
|
||||
return post('/api/auth/login', params)
|
||||
}
|
||||
|
||||
export function register(data: any) {
|
||||
return post('/api/auth/register', data)
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return post('/api/auth/logout')
|
||||
}
|
||||
|
||||
export function getCurrentUser(): Promise<AuthResponse> {
|
||||
return get('/api/auth/me')
|
||||
}
|
||||
Reference in New Issue
Block a user