1 |
- import{b as i,ac as u,K as c,U as h,aJ as n,d as l,aR as f,bb as r,bc as o,a7 as m,P as T,a5 as p,aj as y,s as d}from"./index.4d3e3847.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}}}]])}}),g=e=>n.request("post","/login",{data:e}),k=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)=>{g(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(),k(e).then(t=>{if(t)return r(t),t})}}});function b(){return E(d)}export{v as M,b as u};
|