feat: 实现前端组件库和API服务基础架构
refactor: 移除废弃的AGI策略演进服务 fix: 修正磁盘I/O指标字段命名 chore: 更新项目依赖版本 test: 添加前后端集成测试用例 docs: 更新AI模块接口文档 style: 统一审计日志字段命名规范 perf: 优化Redis订阅连接错误处理 build: 配置多项目工作区结构 ci: 添加Vite开发服务器CORS支持
This commit is contained in:
35
dashboard/src/services/api/user.ts
Normal file
35
dashboard/src/services/api/user.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import apiClient from './client';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
role: string;
|
||||
}
|
||||
|
||||
interface LoginRequest {
|
||||
email: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
interface LoginResponse {
|
||||
token: string;
|
||||
user: User;
|
||||
}
|
||||
|
||||
export const userApi = {
|
||||
login: async (data: LoginRequest): Promise<LoginResponse> => {
|
||||
return apiClient.post('/auth/login', data);
|
||||
},
|
||||
register: async (data: any): Promise<User> => {
|
||||
return apiClient.post('/auth/register', data);
|
||||
},
|
||||
getProfile: async (): Promise<User> => {
|
||||
return apiClient.get('/user/profile');
|
||||
},
|
||||
updateProfile: async (data: any): Promise<User> => {
|
||||
return apiClient.put('/user/profile', data);
|
||||
},
|
||||
};
|
||||
|
||||
export default userApi;
|
||||
Reference in New Issue
Block a user