import{y as a,m as n}from"./app-211db244.js";let t=a.create({baseURL:"/api",timeout:1e4,headers:{"X-Requested-With":"XMLHttpRequest","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]').getAttribute("content")}});t.interceptors.request.use(e=>(e.headers,e.headers.Accept="application/json",e),e=>(console.error(e),Promise.reject(e)));t.interceptors.response.use(e=>Promise.resolve(e),e=>{console.error("axios error",e);let s=[];e.response.data.data&&(s=e.response.data.data),e.response.data.message&&(s=e.response.data.message),e.response.data.error&&(s=e.response.data.error.message),e.response.status===429?alert("请求次数过多"):e.response.status===401||(e.response.status===404?n.push({name:"index"}):s.length!==0&&alert(s))});export{t as i};
