import{aC as o}from"./vendor-DeEI1rpK.js";import{r as s}from"./index-CxJCpQ-E.js";const t=o.create({baseURL:"/api",timeout:1e4});t.interceptors.request.use(e=>{const r=localStorage.getItem("token");return r&&(e.headers.Authorization=`Bearer ${r}`),e},e=>Promise.reject(e));t.interceptors.response.use(e=>e.data,e=>(e.response?.status===401&&(localStorage.removeItem("token"),localStorage.removeItem("riderInfo"),s.push("/login")),Promise.reject(e)));export{t as r};
