| 1 |
- var f=(e,s,t)=>new Promise((n,r)=>{var c=o=>{try{l(t.next(o))}catch(i){r(i)}},a=o=>{try{l(t.throw(o))}catch(i){r(i)}},l=o=>o.done?n(o.value):Promise.resolve(o.value).then(c,a);l((t=t.apply(e,s)).next())});import{f$ as B,g0 as u,g1 as k,ba as y,d as $,c as S,e as h,l as _,j as F,o as M,q as b,y as I,af as m,s as d,w as L,g as v,v as N,z as R,k as g}from"./index-610a1d46.js";import{B as P,b as U}from"./index-985aa6f5.js";import{B as O,u as V}from"./useForm-c19ef35c.js";import{h as j}from"./header-f16d07a5.js";import"./useWindowSizeFn-1829b247.js";import"./index-b6d11df2.js";import"./index-72381a11.js";import"./index-4ed0dc84.js";import"./uuid-98bbe2a6.js";import"./download-a90dd227.js";import"./XTUpload.vue_vue_type_style_index_0_scoped_61a00cd1_lang-bad913d6.js";import"./index-981858ed.js";import"./uniqBy-2b2a500d.js";const q=B({id:"app-lock",state:()=>({lockInfo:u.getLocal(k)}),getters:{getLockInfo(){return this.lockInfo}},actions:{setLockInfo(e){this.lockInfo=Object.assign({},this.lockInfo,e),u.setLocal(k,this.lockInfo,!0)},resetLockInfo(){u.removeLocal(k,!0),this.lockInfo=null},unLock(e){return f(this,null,function*(){var n;const s=y();return((n=this.lockInfo)==null?void 0:n.pwd)===e?(this.resetLockInfo(),!0):yield(()=>f(this,null,function*(){var r;try{const c=(r=s.getUserInfo)==null?void 0:r.username,a=yield s.login({grantType:"1",username:c,password:e,goHome:!1,mode:"none"});return a&&this.resetLockInfo(),a}catch(c){return!1}}))()})}}}),z=$({name:"LockModal",components:{BasicModal:P,BasicForm:O},setup(){const{prefixCls:e}=S("header-lock-modal"),s=y(),t=q(),n=h(()=>{var p;return(p=s.getUserInfo)==null?void 0:p.realName}),[r,{closeModal:c}]=U(),[a,{validateFields:l,resetFields:o}]=V({showActionButtonGroup:!1,schemas:[{field:"password",label:_.header.lockScreenPassword,colProps:{span:24},component:"InputPassword",required:!0}]});function i(){return f(this,null,function*(){const w=(yield l()).password;c(),t.setLockInfo({isLock:!0,pwd:w}),yield o()})}const C=h(()=>{const{avatar:p}=s.getUserInfo;return p||j});return{locales:_,prefixCls:e,getRealName:n,register:r,registerForm:a,handleLock:i,avatar:C}}});const D=["src"];function K(e,s,t,n,r,c){const a=g("BasicForm"),l=g("a-button"),o=g("BasicModal");return M(),b(o,R({footer:null,title:e.locales.header.lockScreen},e.$attrs,{class:e.prefixCls,onRegister:e.register}),{default:I(()=>[m("div",{class:d(`${e.prefixCls}__entry`)},[m("div",{class:d(`${e.prefixCls}__header`)},[m("img",{src:e.avatar,class:d(`${e.prefixCls}__header-img`)},null,10,D),m("p",{class:d(`${e.prefixCls}__header-name`)},L(e.getRealName),3)],2),v(a,{onRegister:e.registerForm},null,8,["onRegister"]),m("div",{class:d(`${e.prefixCls}__footer`)},[v(l,{type:"primary",block:"",class:"mt-2",onClick:e.handleLock},{default:I(()=>[N(L(e.locales.header.lockScreenBtn),1)]),_:1},8,["onClick"])],2)],2)]),_:1},16,["title","class","onRegister"])}const se=F(z,[["render",K]]);export{se as default};
|