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