import{r as f}from"./index-M_JNBppB.js";import{g as n}from"./env-Ba1thpgP.js";async function d(e,s){var r,o;let t;if(e instanceof File)t=e;else if(e.file instanceof File)t=e.file;else if(e.raw instanceof File)t=e.raw;else if((o=(r=e.target)==null?void 0:r.files)!=null&&o[0])t=e.target.files[0];else throw new Error("无法识别的文件参数格式");const l=new FormData;l.append(s,t);let i=await n();return i.includes("/api/v1/")&&(i=i.replace("/api/v1/","")),f({url:i,method:"post",data:l})}export{d as r};
