// 菜单删除
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 = VITE_PROXY_USER_REAL + "/admin/";

// 根据菜单id获取所有功能
export const httpList = (id: string): any => {
  return http.request("post", `${yewuApi}menuaction`, {
    data: {
      id
    }
  });
};

// 功能状态
export const httpStatus = ({
  id,
  status
}: {
  id: string;
  status: string;
}): any => {
  return http.request("post", `${yewuApi}menuactionstatus`, {
    data: { id, status }
  });
};

// 功能删除
export const httpDelete = (data: object): any => {
  return http.request("post", `${yewuApi}menuactiondel`, { data });
};

//功能更新
export const httpUpdate = (data: object): any => {
  return http.request("post", `${yewuApi}menuactionsave`, { data });
};

//功能新增
export const httpAdd = (data: object): any => {
  return http.request("post", `${yewuApi}menuactionadd`, { data });
};
