var k=(o,s,t)=>new Promise((n,r)=>{var c=e=>{try{i(t.next(e))}catch(f){r(f)}},a=e=>{try{i(t.throw(e))}catch(f){r(f)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(c,a);i((t=t.apply(o,s)).next())});import{W as I}from"./vue-08ef39cb.js";import{aq as l,ar as u,ak as L}from"./index.js";const p=I({id:"app-lock",state:()=>({lockInfo:l.getLocal(u)}),getters:{getLockInfo(o){return o.lockInfo}},actions:{setLockInfo(o){this.lockInfo=Object.assign({},this.lockInfo,o),l.setLocal(u,this.lockInfo,!0)},resetLockInfo(){l.removeLocal(u,!0),this.lockInfo=null},unLock(o){return k(this,null,function*(){var n;const s=L();return((n=this.lockInfo)==null?void 0:n.pwd)===o?(this.resetLockInfo(),!0):yield(()=>k(this,null,function*(){var r;try{const c=(r=s.getUserInfo)==null?void 0:r.username,a=yield s.login({username:c,password:o,goHome:!1,mode:"none"});return a&&this.resetLockInfo(),a}catch(c){return!1}}))()})}}});export{p as u};
