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/";
const Api = VITE_PROXY_USER_REAL;

interface postType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}

//导出
export const httpExport = (url: string, data?: object): postType => {
  return http.request("post", `${yewuApi}${url}`, {
    data,
    responseType: "blob"
  });
};


export const httpExportNoAdmin = (url: string, data?: object): postType => {
  return http.request("post", `${Api}${url}`, {
    data,
    responseType: "blob"
  });
};

