增加admin管理帐号和项目的界面--初步实现

This commit is contained in:
Cheng Zhou
2025-12-17 20:12:49 +08:00
parent 4f50237f56
commit c074c2b5bc
18933 changed files with 2088454 additions and 63 deletions
+9 -3
View File
@@ -1,5 +1,11 @@
import { apiGet } from "./axios";
import type { ApiListResponse } from "../types/api";
import { apiGet, apiPatch, apiPost } from "./axios";
import type { ApiListResponse, UserInfo } from "../types/api";
export const fetchUsers = (params?: Record<string, any>) =>
apiGet<ApiListResponse<any>>("/api/v1/users", { params });
apiGet<ApiListResponse<UserInfo>>("/api/v1/users", { params });
export const createUser = (payload: { username: string; password: string; role: string }) =>
apiPost<UserInfo>("/api/v1/users", payload);
export const updateUser = (userId: string, payload: Partial<{ role: string; is_active: boolean; password: string }>) =>
apiPatch<UserInfo>(`/api/v1/users/${userId}`, payload);