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/menuAction`, {
    data
  });
}
// 按钮添加
export async function httpAdd(data: object): Promise<DataType<any[]>> {
  return http.request("post", `${VITE_PROXY_DOMAIN_REAL}admin/menuActionAdd`, {
    data
  });
}
// 按钮编辑
export async function httpUpdate(data: object): Promise<DataType<any[]>> {
  return http.request("post", `${VITE_PROXY_DOMAIN_REAL}admin/menuActionSave`, {
    data
  });
}
// 按钮状态
export async function httpStatus(data: object): Promise<DataType<any[]>> {
  return http.request(
    "post",
    `${VITE_PROXY_DOMAIN_REAL}admin/menuActionStatus`,
    { data }
  );
}
// 按钮删除
export async function httpDelete(data: object): Promise<DataType<any[]>> {
  return http.request("post", `${VITE_PROXY_DOMAIN_REAL}admin/menuActionDel`, {
    data
  });
}
