diff --git a/frontend/src/services/apis/index.ts b/frontend/src/services/apis/index.ts index 213cf471..678074a4 100644 --- a/frontend/src/services/apis/index.ts +++ b/frontend/src/services/apis/index.ts @@ -1,5 +1,5 @@ import { useDefineApi } from "@/stores/useDefineApi"; -import type { InstanceDetail, NodeStatus, Settings } from "@/types"; +import type { InstanceDetail, NodeStatus, Settings, UserInfo } from "@/types"; import type { BaseUserInfo } from "@/types/user"; import type { IPanelOverviewResponse } from "../../../../common/global"; @@ -71,6 +71,48 @@ export const setSettingInfo = useDefineApi< method: "PUT" }); +// 用户管理 +// 用户管理 获取信息 +export const getUserInfo = useDefineApi< + { + params: { + userName: string; + page: number; + page_size: number; + }; + }, + { total: number; pageSize: number; page: number; maxPage: number; data: UserInfo[] } +>({ + url: "/api/auth/search", + method: "GET" +}); + +// 用户管理 删除用户 +export const deleteUser = useDefineApi< + { + data: string[]; + }, + any +>({ + url: "/api/auth", + method: "DELETE" +}); + +// 用户管理 新增用户 +export const addUser = useDefineApi< + { + data: { + username: string; + password: string; + permission: number; + }; + }, + boolean +>({ + url: "/api/auth", + method: "POST" +}); + // 获取总览 // 获取设置信息 diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index f09c9d8a..4ce3e245 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -1,3 +1,4 @@ +/* eslint-disable no-unused-vars */ import type { IGlobalInstanceConfig } from "./../../../common/global"; import type { LayoutCardHeight } from "@/config/originLayoutConfig"; @@ -85,3 +86,15 @@ export interface Settings { quickInstallAddr: string; redisUrl: string; } + +export interface UserInfo { + uuid: string; + userName: string; + registerTime: string; + permission: number; + passWordType: number; + loginTime: string; + isInit: boolean; + instances: any[]; + apiKey: string; +} diff --git a/frontend/src/widgets/UserList.vue b/frontend/src/widgets/UserList.vue index d6df2de1..be6718b1 100644 --- a/frontend/src/widgets/UserList.vue +++ b/frontend/src/widgets/UserList.vue @@ -1,103 +1,80 @@ @@ -189,17 +369,13 @@ const rowSelection = () => {}; transition: all 0.4s; text-align: center; width: 50%; -} -@media (max-width: 992px) { - .search-input { - transition: all 0.4s; - text-align: center; + &:hover { + width: 100%; + } + + @media (max-width: 992px) { width: 100% !important; } } - -.search-input:hover { - width: 100%; -}