lock-CXIvsytY.js 934 B

1
  1. var l=(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{V as I}from"./vue-CF9JqwIh.js";import{bc as u,bn as k,a as L}from"./entry/index-BaQQ7BQ_.js";const p=I({id:"app-lock",state:()=>({lockInfo:u.getLocal(k)}),getters:{getLockInfo(o){return o.lockInfo}},actions:{setLockInfo(o){this.lockInfo=Object.assign({},this.lockInfo,o),u.setLocal(k,this.lockInfo,!0)},resetLockInfo(){u.removeLocal(k,!0),this.lockInfo=null},unLock(o){return l(this,null,function*(){var s;const r=L();return((s=this.lockInfo)==null?void 0:s.pwd)===o?(this.resetLockInfo(),!0):yield l(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};