import { loadEnv } from "@build/index";
import { http } from "/@/utils/http";

const { VITE_PROXY_DOMAIN_REAL } = loadEnv();

//分页查询
export async function httpList(data: object): Promise<DataType<any[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/AccoountList`, {
    data
  });
}
//详情
export async function httpDetail(data: object): Promise<DataType<any[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/AccoountRead`, {
    data
  });
}
//更新
export async function httpUpdate(data: object): Promise<DataType<any[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/AccoountEdit`, {
    data
  });
}
//添加
export async function httpAdd(data: object): Promise<DataType<any[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/AccountAdd`, {
    data
  });
}
// 删除
export async function httpDelete(data: object = {}): Promise<DataType<any>> {
  return http.request("post", `${VITE_PROXY_DOMAIN_REAL}admin/AccoountDelete`, {
    data
  });
}
//重置密码
export async function setpwd(data: object): Promise<DataType<any[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/checkpwd`, {
    data
  });
}
