feat: ✨ 前端:玩家服务平台和运营管理系统后台初始化及框架搭建,后端:完成基础功能搭建。
This commit is contained in:
25
frontend/src/services/adminAuthService.ts
Normal file
25
frontend/src/services/adminAuthService.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import api from '../utils/api';
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
accessToken: string;
|
||||
userId: number;
|
||||
username: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
export const adminAuthService = {
|
||||
async login(data: LoginRequest): Promise<LoginResponse> {
|
||||
const response = await api.post<LoginResponse>('/admin/auth/login', data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
async logout(): Promise<{ message: string }> {
|
||||
const response = await api.post<{ message: string }>('/admin/auth/logout');
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user