import{d as I,f,e as g,u as t,w as Q,a2 as b,a3 as w,k as o,a4 as y,af as p,G as _,a5 as v,F as B,V as L}from"./vue-vendor-CxLCUzY4.js";import T from"./LoginFormTitle-Bwlk5a95.js";import{W as V,B as q}from"./antd-vue-vendor-CDWW6V_M.js";import{Q as N}from"./index-DpxmcUhi.js";import{ab as D,bB as E,bH as F,K as j,bO as O,bP as U}from"./index-B_2CoVdl.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./vxe-table-vendor-B5h3MVdD.js";const z={class:"enter-x min-w-64 min-h-64"},M=I({__name:"QrCodeForm",setup(G){const c=f("");let a;const{t:n}=j(),k=D(),{handleBackLogin:C,getLoginState:h}=E(),s=f("0"),i=g(()=>t(h)===F.QR_CODE),x=g(()=>t(s)==="0"?n("sys.login.scanSign"):n("sys.login.scanSuccess"));function l(){s.value="0",O().then(e=>{c.value=e.qrcodeId,e.qrcodeId&&S(e.qrcodeId)})}function u(e){U({qrcodeId:e}).then(r=>{let d=r.token;d=="-2"&&(l(),clearInterval(a)),r.success&&(s.value="2",clearInterval(a),setTimeout(()=>{k.qrCodeLogin(d)},500))})}function S(e){u(e),m(),a=setInterval(()=>{u(e)},1500)}function m(){a&&clearInterval(a)}return Q(i,e=>{e?l():m()}),(e,r)=>i.value?(b(),w(B,{key:0},[o(T,{class:"enter-x"}),y("div",z,[o(t(N),{value:c.value,class:"enter-x flex justify-center xl:justify-start",width:280},null,8,["value"]),o(t(V),{class:"enter-x"},{default:p(()=>[_(v(x.value),1)]),_:1}),o(t(q),{size:"large",block:"",class:"mt-4 enter-x",onClick:t(C)},{default:p(()=>[_(v(t(n)("sys.login.backSignIn")),1)]),_:1},8,["onClick"])])],64)):L("",!0)}});export{M as default};
