import{_ as K}from"./index-1faadda2.js";import{d as L,q as S,u as T,y as U,a as x,f as z,m as a,e as o,b as t,h as s,t as C,aA as V,ac as I,c as N,j as A,J as H,g,Z as k,aq as O,aB as P,k as Z,at as J,au as Q,X,Y,S as G,_ as W,aC as ee,K as oe}from"./index-3ac32eb9.js";import{_ as se}from"./_plugin-vue_export-helper-c27b6911.js";const te="/assets/png/8671-7850586f.png",le={class:"login-main flex justify-center items-center"},ne={class:"login-container"},ae={class:"text-2xl text-[var(--el-color-info)]",style:{"margin-left":"10px"}},re={class:"p-2 text-white"},ie={class:"p-2 text-white"},ce={class:"p-2 text-white"},de=["innerHTML"],ue=L({__name:"index-modern",setup(pe){const w=g(),v=g(k),b=S(),E=T(),p=oe({loginData:{account:"",password:"",verifyCode:""},loginRules:{account:[{required:!0,trigger:"blur",message:"用户名不能为空"}],password:[{required:!0,trigger:"blur",validator:R}],verifyCode:[{required:!0,trigger:"blur",message:"请输入验证码"}]},passwordVisible:!1,loading:!1}),{loginData:c,loginRules:M,passwordVisible:f,loading:q}=O(p);function R(l,e,n){e.length<6&&e.length>0?n(new Error("密码个数不能小于6")):e.length===0?n(new Error("密码不能为空")):n()}const y=g(!1);function B(l){const{key:e}=l;y.value=e&&e.length===1&&e>="A"&&e<="Z"}const h=()=>{P().then(l=>{w.value=l})};function _(){v.value.validate(l=>{l&&(p.loading=!0,b.login(p.loginData).then(()=>{const e=E.query,n=e.redirect??"/",u=Object.keys(e).reduce((r,i)=>(console.log("output->acc,cur",r,i),i!=="redirect"&&(r[i]=e[i]),r),{});Z.push({path:n,query:u})}).finally(()=>{p.loading=!1}))})}return U(()=>{h()}),(l,e)=>{const n=J,u=Q,r=K,i=X,m=Y,$=G,j=W,D=k,F=ee;return x(),z("div",le,[a("div",ne,[o(u,{gutter:20,class:"h-100%"},{default:t(()=>[o(n,{span:16,offset:0,class:"flex! justify-center items-center"},{default:t(()=>[...e[4]||(e[4]=[a("img",{src:te,alt:"",class:"w-90%"},null,-1)])]),_:1}),o(n,{span:8,offset:0,class:"flex! items-center justify-center"},{default:t(()=>[o(D,{ref_key:"loginFormRef",ref:v,model:s(c),rules:s(M),class:"w-80%"},{default:t(()=>[o(u,{gutter:20},{default:t(()=>[o(n,{span:24,offset:0,class:"flex! items-center"},{default:t(()=>[e[5]||(e[5]=a("img",{src:"",class:"w-22px"},null,-1)),a("span",ae,C(l.$t("login.title")),1)]),_:1})]),_:1}),o(u,{gutter:20,style:{"margin-top":"20px"}},{default:t(()=>[o(n,{span:24,offset:0},{default:t(()=>[o(m,{prop:"account"},{default:t(()=>[a("div",re,[o(r,{"icon-class":"user",color:"var(--el-color-warning)"})]),o(i,{class:"flex-1",ref:"account",size:"large",modelValue:s(c).account,"onUpdate:modelValue":e[0]||(e[0]=d=>s(c).account=d),modelModifiers:{trim:!0},placeholder:l.$t("login.username"),name:"account"},null,8,["modelValue","placeholder"])]),_:1}),o($,{disabled:s(y)===!1,content:"Caps lock is On",placement:"right"},{default:t(()=>[o(m,{prop:"password"},{default:t(()=>[a("span",ie,[o(r,{"icon-class":"password",color:"var(--el-color-warning)"})]),o(i,{class:"flex-1",modelValue:s(c).password,"onUpdate:modelValue":e[1]||(e[1]=d=>s(c).password=d),modelModifiers:{trim:!0},placeholder:l.$t("login.password"),type:s(f)===!1?"password":"input",size:"large",name:"password",onKeyup:[B,V(_,["enter"])]},null,8,["modelValue","placeholder","type"]),a("span",{class:"mr-2",onClick:e[2]||(e[2]=d=>f.value=!s(f))},[o(r,{"icon-class":s(f)===!1?"eye":"eye-open",color:"var(--el-color-warning)",class:"text-white cursor-pointer"},null,8,["icon-class"])])]),_:1})]),_:1},8,["disabled"]),o(m,{prop:"verifyCode"},{default:t(()=>[a("span",ce,[o(r,{"icon-class":"valid_code",color:"var(--el-color-warning)"})]),o(i,{modelValue:s(c).verifyCode,"onUpdate:modelValue":e[3]||(e[3]=d=>s(c).verifyCode=d),modelModifiers:{trim:!0},"auto-complete":"off",placeholder:l.$t("login.code"),class:"w-60%!",onKeyup:V(_,["enter"])},null,8,["modelValue","placeholder"]),a("div",{class:"captcha",onClick:h,innerHTML:s(w)},null,8,de)]),_:1}),I((x(),N(j,{size:"large",type:"warning",class:"w-100%",onClick:A(_,["prevent"])},{default:t(()=>[H(C(l.$t("login.login")),1)]),_:1})),[[F,s(q)]])]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})])])}}});const ge=se(ue,[["__scopeId","data-v-499012ba"]]);export{ge as default};
