const baseUrl = "https://www.xunlianying.vip";

function post(url, data, isFormData) {
  const header = {
    authorization: `${localStorage.getItem("AUTH")}`,
  };

  const headerJson = {
    authorization: `${localStorage.getItem("AUTH")}`,
    "content-type": "application/json",
  };

  const options = {
    method: "POST",
    body: isFormData !== true ? JSON.stringify(data) : data ,
    headers: isFormData !== true ? { ...header, ...headerJson } : header,
  };
  return fetch(`${baseUrl}${url}`, options).then((res) => res.json()).catch((r) => r).then((rr) => rr);
}






const requestUploadFile1 = async (data) => await post("/horse/v1/card/image/save", data, true) ;

export { requestUploadFile1 as r };
