import{o as n,c as a,w as i,a as o,b as l,u as e,t as f,f as d,h as r,s as p}from"./app-BYcXwl4U.js";/* empty css            */import{i as _,c as h}from"./app-a6cKceqE.js";import{_ as b}from"./app-CQ-vNlMj.js";import{_ as g}from"./app-CMBe1IbX.js";import{_ as x}from"./app-Ufpj4Ll4.js";import{T as c}from"./app-CrjU8lgK.js";import{_ as S}from"./app-Dm_95vqi.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BG60hdvp.js";import"./app-BQ5ggxk2.js";import"./app-SxAW7vhf.js";import"./app-D3zbrzdO.js";import"./app-u5shTDG_.js";import"./app-SsPWW0_a.js";import"./app-C14NbwKQ.js";function w(){_(this),this.otpCode="",this.isSubmitting=!1,this.encodedFrom=window.encodeURIComponent(this.from),this.$delay(function(){this.$find("form input[name='otpCode']").focus()}),this.moreOptionsVisible=!1,this.showMoreOptions=function(){this.moreOptionsVisible=!this.moreOptionsVisible},this.submitBefore=function(){this.isSubmitting=!0},this.submitDone=function(){this.isSubmitting=!1},this.submitSuccess=function(s){localStorage.setItem("sid",s.data.localSid),localStorage.setItem("ip",s.data.ip),this.$delay(function(){this.from.length==0?window.location="/dashboard":window.location=this.from})}}const y={class:"form-box"},C=["value"],v=["value"],V={class:"flex flex-col gap-4 border-gray-200 border p-4 rounded-xl"},B={class:"field text-center"},$=o("div",{class:"ui field"}," 为了保护你的账户安全，需要进行OTP二次身份验证。 ",-1),O={class:"ui field"},D={class:"field"},N={class:"ui field cancel-login"},T=["href"],k={__name:"otp",setup(s){const t=h(new w);return(I,m)=>(n(),a(S,null,{default:i(()=>[o("div",y,[l(b,{action:"$",onBefore:e(t).submitBefore,onDone:e(t).submitDone,onSuccess:e(t).submitSuccess,disableCSRF:"",autocomplete:"off"},{default:i(()=>[o("input",{type:"hidden",name:"sid",value:e(t).sid},null,8,C),o("input",{type:"hidden",name:"remember",value:e(t).remember?1:0},null,8,v),o("div",V,[o("div",B,[o("h6",null,"登录"+f(e(t).systemName),1)]),$,o("div",O,[l(g,{beginIcon:"pi pi-barcode"},{default:i(()=>[l(x,{type:"text",fieldname:"otpCode",name:"otpCode",modelValue:e(t).otpCode,"onUpdate:modelValue":m[0]||(m[0]=u=>e(t).otpCode=u),placeholder:"请输入OTP动态密码",maxlength:"6",class:"w-full"},null,8,["modelValue"])]),_:1})]),o("div",D,[e(t).isSubmitting?r("",!0):(n(),a(c,{key:0,class:"w-full",type:"submit"},{default:i(()=>[d("验证")]),_:1})),e(t).isSubmitting?(n(),a(c,{key:1,class:"w-full",disabled:"",type:"submit"},{default:i(()=>[d("验证中...")]),_:1})):r("",!0)]),o("div",N,[o("a",{href:"/?from="+e(t).encodedFrom},"« 取消登录",8,T)])])]),_:1},8,["onBefore","onDone","onSuccess"])])]),_:1}))}};p({app:k,useRouter:!1});
