Files
labelmain-demo/components/label/api/user/index.ts
2026-02-24 16:23:48 +08:00

33 lines
804 B
TypeScript

import httpFetch from "@/api/fetch"
import { BASE_LABEL_API } from "../const"
import { Organization } from "./typing"
// 获取用户组织树
export const getUserGroupTree = () => {
return httpFetch<Organization.Response[]>({
url: "/api/v1/label_server/user/group/tree",
method: "GET",
})
}
/* ****************************** Options ****************************** */
interface Option {
label: string
value: string
}
// 获取所有用户组
export const getUserGroupAll = () => {
return httpFetch<Array<Option>>({
url: BASE_LABEL_API + `/api/v1/label_server/user/group/all`,
method: "GET",
})
}
// 获取所有用户
export const getUserAll = () => {
return httpFetch<Array<Option>>({
url: BASE_LABEL_API + "/api/v1/label_server/user/all",
method: "GET",
})
}