帐号治理-帐号管理--更新

This commit is contained in:
Cheng Zhou
2025-12-18 19:14:38 +08:00
parent f6b89cb8c4
commit eed83cec5a
23 changed files with 233 additions and 30 deletions
+4
View File
@@ -1,5 +1,6 @@
import { apiGet, apiPatch, apiPost } from "./axios";
import type { ApiListResponse, UserInfo } from "../types/api";
import { apiDelete } from "./axios";
export const fetchUsers = (params?: Record<string, any>) =>
apiGet<ApiListResponse<UserInfo>>("/api/v1/users", { params });
@@ -9,3 +10,6 @@ export const createUser = (payload: { username: string; password: string; role:
export const updateUser = (userId: string, payload: Partial<{ role: string; is_active: boolean; password: string }>) =>
apiPatch<UserInfo>(`/api/v1/users/${userId}`, payload);
export const deleteUser = (userId: string, payload: { admin_password: string }) =>
apiDelete<void>(`/api/v1/users/${userId}`, { data: payload });