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