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

const { VITE_PROXY_DOMAIN_REAL } = loadEnv();

export async function httpRoleAll(
  data: object = {}
): Promise<DataType<RoleNode[]>> {
  return http.request(`post`, `${VITE_PROXY_DOMAIN_REAL}admin/roleall`, {
    data
  });
}

//获取所有的流程节点
export async function httpProcessAll(
  data: object = {}
): Promise<DataType<ProcessNode[]>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/action_process_all`,
    {
      data
    }
  );
}

//获取某一角色的流程节点
export async function httpRoleProcess(
  data: object = {}
): Promise<DataType<RoleProcess>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/role_process_info`,
    {
      data
    }
  );
}
