import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = 'http://project.test241.wanyuhengtong.com' + "/admin/";
interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}

// 获取用户列表
export const httpUserList = (): ResponseType => {
  return http.request("post", `${VITE_PROXY_USER_REAL}/admin/userall`, { data: {} });
};

//用户组列表
export const httpList = (data): ResponseType => {
  return http.request("post", `${yewuApi}getDataGroupList`, { data });
};

//添加用户组
export const httpAdd = (data): ResponseType => {
  return http.request("post", `${yewuApi}addDataGroup`, { data });
};

//获取用户组详情
export const httpDetail = (data): ResponseType => {
  return http.request("post", `${yewuApi}getDataGroupDetail`, { data });
};

//编辑用户组
export const httpUpdate = (data): ResponseType => {
  return http.request("post", `${yewuApi}editDataGroup`, { data });
};

//用户组启用禁用
export const httpStatus = (data): ResponseType => {
  return http.request("post", `${yewuApi}statusDataGroup`, { data });
};
