feat(team): add page
This commit is contained in:
@@ -1,15 +1,72 @@
|
||||
import httpFetch from "@/api/fetch"
|
||||
import { BASE_LABEL_API } from "../const"
|
||||
import { Organization } from "./typing"
|
||||
import { Organization, User } from "./typing"
|
||||
|
||||
// 获取用户列表
|
||||
export const getUserList = (params: User.ListRequest) => {
|
||||
return httpFetch<User.ListResponse>({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/list",
|
||||
method: "GET",
|
||||
data: params,
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
export const userAdd = (data: User.CreateProps) => {
|
||||
return httpFetch({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/add",
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
// 批量导入用户
|
||||
export const userImport = (data: { user_infos: any[] }) => {
|
||||
return httpFetch<string[]>({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/batch_add",
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑用户
|
||||
export const userEditById = (data: User.EditProps, id: number) => {
|
||||
return httpFetch({
|
||||
url: BASE_LABEL_API + `/api/v1/label_server/user/edit/${id}`,
|
||||
method: "PUT",
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户组织树
|
||||
export const getUserGroupTree = () => {
|
||||
return httpFetch<Organization.Response[]>({
|
||||
url: "/api/v1/label_server/user/group/tree",
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/group/tree",
|
||||
method: "GET",
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用户组
|
||||
export const userGroupAdd = (data: Organization.CreateProps) => {
|
||||
return httpFetch({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/group/add",
|
||||
method: "POST",
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用户密码
|
||||
export const modifyUserPassword = (data: {
|
||||
old_password: string
|
||||
new_password: string
|
||||
}) => {
|
||||
return httpFetch({
|
||||
url: BASE_LABEL_API + "/api/v1/label_server/user/modify_password",
|
||||
method: "PUT",
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
/* ****************************** Options ****************************** */
|
||||
interface Option {
|
||||
label: string
|
||||
|
||||
Reference in New Issue
Block a user