import{B as n}from"./D7LY3N47.js";const e="aidev-ui-token";function u(){return async(s,a={})=>{const o=localStorage.getItem(e),r={...a.headers??{}};o&&(r.Authorization=`Bearer ${o}`);try{return await $fetch(s,{...a,headers:r})}catch(t){throw(t?.response?.status??t?.statusCode)===401&&(localStorage.removeItem(e),await n("/login")),t}}}function l(){localStorage.removeItem(e)}export{l as c,u};
