refactor: 移除废弃的AGI策略演进服务 fix: 修正磁盘I/O指标字段命名 chore: 更新项目依赖版本 test: 添加前后端集成测试用例 docs: 更新AI模块接口文档 style: 统一审计日志字段命名规范 perf: 优化Redis订阅连接错误处理 build: 配置多项目工作区结构 ci: 添加Vite开发服务器CORS支持
35 lines
719 B
TypeScript
35 lines
719 B
TypeScript
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; |