新增用户注册功能

This commit is contained in:
Cheng Zhou
2025-12-22 21:19:48 +08:00
parent 03fddba406
commit 6ddf9901a0
33 changed files with 1389 additions and 138 deletions
+11 -2
View File
@@ -5,10 +5,19 @@ import { apiDelete } from "./axios";
export const fetchUsers = (params?: Record<string, any>) =>
apiGet<ApiListResponse<UserInfo>>("/api/v1/users", { params });
export const createUser = (payload: { username: string; password: string; role: string }) =>
export const createUser = (payload: {
email: string;
password: string;
full_name: string;
role: string;
department: string;
}) =>
apiPost<UserInfo>("/api/v1/users", payload);
export const updateUser = (userId: string, payload: Partial<{ role: string; is_active: boolean; password: string }>) =>
export const updateUser = (
userId: string,
payload: Partial<{ role: string; status: string; password: string; full_name: string; department: string; is_active: boolean }>
) =>
apiPatch<UserInfo>(`/api/v1/users/${userId}`, payload);
export const deleteUser = (userId: string, payload: { admin_password: string }) =>