lock.e396c5c7.js 921 B

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