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-DA7OTM4Q.js";/* empty css            */import{i as _,c as h}from"./app-BT68AfZ-.js";import{_ as b}from"./app-DokSVapq.js";import{_ as g}from"./app-ZGhHKWIW.js";import{_ as x}from"./app-DuUYZNNT.js";import{T as c}from"./app-Zes_jb7S.js";import{_ as S}from"./app-BBZP5Ezi.js";import"./app-C-GI59rl.js";import"./app-DSiZNBrr.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-WOreqTiW.js";import"./app-tdOn1PbY.js";import"./app-CVfeXVc-.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});
