1 |
- import{q as h,O as f,ah as l,as as d,aY as r,aZ as m,a_ as p,l as E,a$ as T,b0 as i,b1 as y,b2 as g,ap as k,X as _,ag as S,b3 as A,s as I}from"./index.8c199c36.js";var L=h({name:"Motion",props:{delay:{type:Number,default:50}},render(){const{delay:e}=this,t=d("motion");return f(l("div",{},{default:()=>[this.$slots.default()]}),[[t,{initial:{opacity:0,y:100},enter:{opacity:1,y:0,transition:{delay:e}}}]])}});const{VITE_PROXY_DOMAIN_REAL:R,VITE_PROXY_USER_REAL:M}=m(),O=R,P=M+"/admin/",U=e=>r.request("post",`${O}/Api/login`,{data:e}),v=e=>r.request("post",`${P}/Admin/menu`,{data:e}),N=e=>r.request("post","/refreshToken",{data:e}),b=p(),q=E({id:"pure-user",state:()=>({token:T(),name:"admin",verifyCode:"",currentPage:0,userInfo:b||null}),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},SET_USERINFO(e){this.userInfo=e},async loginByUsername(e){return new Promise((t,n)=>{U(e).then(s=>{const{code:o,data:a}=s;if(o===0){const{token:u,userinfo:c}=a;i(u),y(c),t(s)}else t(s)}).catch(s=>{n(s)})})},async postMenuList(e){return new Promise((t,n)=>{v(e).then(s=>{const{code:o,data:a}=s;t(s)}).catch(s=>{n(s)})})},logOut(){this.token="",this.name="",g(),k.clear(),_().handleTags("equal",S),A.push("/login")},async refreshToken(e){return N(e).then(t=>{if(t)return i(t),t})}}});function w(){return q(I)}export{L as M,w as u};
|