var d=Object.defineProperty,h=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var s=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var n=(e,a,t)=>a in e?d(e,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[a]=t,o=(e,a)=>{for(var t in a||(a={}))k.call(a,t)&&n(e,t,a[t]);if(s)for(var t of s(a))f.call(a,t)&&n(e,t,a[t]);return e},c=(e,a)=>h(e,g(a));import{q as l,s as p,x as T,y as m,z as y,A as i,B as z}from"./index.4a6e9266.js";const w=l({id:"tenant",state:()=>({account:"",token:"",id:""}),getters:{},actions:{logout(){this.$patch({account:"",token:"",id:""}),p()},async login(e,a){const t=await T({user_id:e,user_password:a});return t.data.token&&(this.$patch(c(o({account:e},t.data),{id:"true"})),m(t.data.token),y(t),console.log("authorize success!")),new Promise((r,u)=>{t.data.message?u(t.data.message):r(t.data)})},async reflush(){if(i()){const e=JSON.parse(z()),a=i();this.$patch({account:e.account,token:a,id:e.id})}}}});export{w as u};
