import{a as i,a7 as u,Z as c,J as h,ak as n,d as l,aA as f,aY as r,aZ as o,a2 as m,D as T,a0 as p,af as y,s as d}from"./index.4d061c66.js";const v=i({name:"Motion",props:{delay:{type:Number,default:50}},render(){const{delay:e}=this,t=u("motion");return c(h("div",{},{default:()=>[this.$slots.default()]}),[[t,{initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:e}}}]])}}),k=e=>n.request("post","/login",{data:e}),g=e=>n.request("post","/refreshToken",{data:e}),E=l({id:"pure-user",state:()=>({token:f(),name:"admin",verifyCode:"",currentPage:0}),actions:{SET_TOKEN(e){this.token=e},SET_NAME(e){this.name=e},SET_VERIFYCODE(e){this.verifyCode=e},SET_CURRENTPAGE(e){this.currentPage=e},async loginByUsername(e){return new Promise((t,a)=>{k(e).then(s=>{s&&(r(s),t())}).catch(s=>{a(s)})})},logOut(){this.token="",this.name="",o(),m.clear(),T().handleTags("equal",p),y.push("/login")},async refreshToken(e){return o(),g(e).then(t=>{if(t)return r(t),t})}}});function C(){return E(d)}export{v as M,C as u};