import{a as i}from"./axios.bb68202d.js";const o="2d0ee1JYallYIYnP933n6e1SAChayy9g9HiFlJr2Uqqex_b8iQSgqf9ai1uJYjiR2xUbl9FwcAL2mi6AxNzoTGENzp7H5Ib0",d=i.create({baseURL:window.GLOBAL_CONFIG.api,timeout:3*1e3,headers:{"Content-Type":"application/x-www-form-urlencoded"},method:"post"});d.interceptors.request.use(async e=>{var a,r,t;return((a=e.method)==null?void 0:a.toLocaleLowerCase())==="get"?e.params=Object.assign({token:o},e.params):e.data=Object.assign({token:o,client:"web",api:"json",site:"tyyx",issubmit:((r=e.url)==null?void 0:r.endsWith("add"))||((t=e.url)==null?void 0:t.endsWith("edit"))?"1":void 0},e.data),e},e=>(console.error("request error: ",e),Promise.reject(e)));d.interceptors.response.use(e=>{var t,s;e.data.code=(s=(t=e.data)==null?void 0:t.code)==null?void 0:s.toString(),e.data.msg=e.data.msg.replaceAll(/<.*?>/g," ");const{code:a,msg:r}=e.data;return a!=="1"&&showFailToast(r),e.data},e=>(console.error(`response error: ${e}`),Promise.reject(e)));export{d as _};
