import{d as j,V as P,r as b,u as R,a as S,b as B,e as I,f as q,h as z,o as H,i as u,j as e,w as s,p as r,A as l,l as n,Q as V,hj as A,_ as O,k as D,N as E,P as K,m as L,L as M,B as Q,S as $,t as F,v as G}from"./index-9PRMimni.js";const J={class:"login"},W={class:"form"},X={class:"shadow-xl login-right-form login-form"},Y={class:"flex justify-end"},Z={class:"flex justify-center"},ee=j({__name:"login",setup(oe){const{t:o}=P(),x=b(),m=R(),h=b(!1),a=S({username:"admin",password:"123456",isCaptcha:!1}),k={username:{required:!0,message:o("common.userController.placeholderUsername"),trigger:"blur"},password:{required:!0,message:o("common.userController.placeholderUsername"),trigger:"blur"}},T=B(),v=I(),w=q(),y=C=>{C.preventDefault(),x.value.validate(async t=>{if(t)m.error(o("common.RequireTips"));else{const{username:_,password:p}=a;m.loading(o("common.loadingText")),h.value=!0;const i={username:_,password:p};if(await T.login(i)){const c=decodeURIComponent(w.query?.redirect||"/");m.success(o("common.loginSuccessText")),v.replace(c).then(d=>{w.name=="login"&&v.replace("/")})}else m.info(o("common.loginErrorText"))}})};return(C,t)=>{const _=V,p=A,i=E,f=D,c=O,d=Q,N=$,U=F;return H(),z("div",J,[t[2]||(t[2]=u("div",{class:"bg"},null,-1)),u("div",W,[u("div",X,[e(_,{class:"flex justify-center",style:{margin:"0"}},{default:s(()=>[r(l(n(o)("common.welcomeH1")),1)]),_:1}),e(p,{class:"flex justify-center",style:{margin:"0 0 40px 0"}},{default:s(()=>[r(l(n(o)("common.welcomeH2")),1)]),_:1}),e(U,{ref_key:"formRef",ref:x,"label-placement":"left",size:"large",model:a,rules:k},{default:s(()=>[e(c,{path:"username"},{default:s(()=>[e(f,{value:a.username,"onUpdate:value":t[0]||(t[0]=g=>a.username=g),placeholder:n(o)("common.userController.placeholderUsername"),class:"rounded-xl"},{prefix:s(()=>[e(i,{size:"18",color:"#808695"},{default:s(()=>[e(n(K))]),_:1})]),_:1},8,["value","placeholder"])]),_:1}),e(c,{path:"password"},{default:s(()=>[e(f,{value:a.password,"onUpdate:value":t[1]||(t[1]=g=>a.password=g),type:"password",showPasswordOn:"click",placeholder:n(o)("common.userController.placeholderPassword"),onKeyup:L(y,["enter"]),class:"rounded-xl"},{prefix:s(()=>[e(i,{size:"18",color:"#808695"},{default:s(()=>[e(n(M))]),_:1})]),_:1},8,["value","placeholder"])]),_:1}),u("div",Y,[e(d,{text:"",type:"info"},{default:s(()=>[r(l(n(o)("common.userController.forgetPassword")),1)]),_:1})]),e(c,{class:"mt-6"},{default:s(()=>[e(d,{type:"primary",onClick:y,size:"large",loading:h.value,block:"",class:"rounded-3xl"},{default:s(()=>[r(l(n(o)("common.loginText")),1)]),_:1},8,["loading"])]),_:1}),u("div",Z,[e(N,{depth:"3"},{default:s(()=>[r(l(n(o)("common.noAccountText")),1)]),_:1}),e(d,{text:"",type:"info"},{default:s(()=>[r(l(n(o)("common.createAccountText")),1)]),_:1})])]),_:1},8,["model"])])])])}}}),ne=G(ee,[["__scopeId","data-v-f9c4f9e0"]]);export{ne as default};
