import{d as I,r as k,u as L,a as R,b as S,e as U,f as q,h as O,o as A,j as e,w as s,M as V,i as n,p as t,O as G,l as _,Q as H,t as K,_ as M,k as W,N as $,P as D,m as E,L as F,B as Q,S as T,G as J,H as X,I as Y,q as Z,s as ee,U as se,v as oe}from"./index-9PRMimni.js";import{_ as ne}from"./logo-ALUC3Uje.js";import{d as te}from"./default_avatar-BWot43zP.js";const ae="/assets/logo-left-orP2WSfv.svg",le={class:"login"},re={class:"shadow-xl login-right-form"},_e={class:"flex justify-center"},ie={class:"flex justify-end"},ue={class:"flex justify-center"},ce=I({__name:"login",setup(de){const g=k(),i=L(),v=k(!1),a=R({username:"admin",password:"123456",isCaptcha:!1}),N={username:{required:!0,message:"请输入用户名",trigger:"blur"},password:{required:!0,message:"请输入密码",trigger:"blur"}},P=S(),x=U(),w=q(),y=h=>{h.preventDefault(),g.value.validate(async o=>{if(o)i.error("请填写完整信息");else{const{username:u,password:p}=a;i.loading("登录中..."),v.value=!0;const f={username:u,password:p};if(await P.login(f)){const c=decodeURIComponent(w.query?.redirect||"/");i.success("登录成功！"),x.replace(c).then(d=>{w.name=="login"&&x.replace("/")})}else i.info("登录失败")}})};return(h,o)=>{const u=V,p=G,f=H,l=$,c=W,d=M,r=Q,b=T,j=J,C=X,z=K,B=se;return A(),O("div",le,[e(B,{"x-gap":"12",cols:"1 s:1 m:1 l:12 xl:12 2xl:12",responsive:"screen"},{default:s(()=>[e(u,{span:4,class:"login-left"},{default:s(()=>o[2]||(o[2]=[n("div",{class:"login-left-logo"},[n("img",{src:ne,alt:""}),t(" Naive Admin Plus ")],-1),n("div",{class:"login-left-title"},"开箱即用",-1),n("div",{class:"login-left-text"}," 颜值与实用并存，中后台前后端框架一站式解决方案",-1),n("div",{class:"logo-left"},[n("img",{src:ae,alt:""})],-1)])),_:1}),e(u,{span:8,class:"login-right"},{default:s(()=>[n("div",re,[n("div",_e,[e(p,{round:"",src:_(te),size:80,class:"shadow-xl"},null,8,["src"])]),e(f,{class:"flex justify-center"},{default:s(()=>o[3]||(o[3]=[t(" 欢迎来到 Naive Admin Plus! 👋 ")])),_:1}),e(z,{ref_key:"formRef",ref:g,"label-placement":"left",size:"large",model:a,rules:N},{default:s(()=>[e(d,{path:"username"},{default:s(()=>[e(c,{value:a.username,"onUpdate:value":o[0]||(o[0]=m=>a.username=m),placeholder:"请输入用户名",class:"rounded-xl"},{prefix:s(()=>[e(l,{size:"18",color:"#808695"},{default:s(()=>[e(_(D))]),_:1})]),_:1},8,["value"])]),_:1}),e(d,{path:"password"},{default:s(()=>[e(c,{value:a.password,"onUpdate:value":o[1]||(o[1]=m=>a.password=m),type:"password",showPasswordOn:"click",placeholder:"请输入密码",onKeyup:E(y,["enter"]),class:"rounded-xl"},{prefix:s(()=>[e(l,{size:"18",color:"#808695"},{default:s(()=>[e(_(F))]),_:1})]),_:1},8,["value"])]),_:1}),n("div",ie,[e(r,{text:"",type:"info"},{default:s(()=>o[4]||(o[4]=[t(" 忘记密码 ")])),_:1})]),e(d,{class:"mt-6"},{default:s(()=>[e(r,{type:"primary",onClick:y,size:"large",loading:v.value,block:"",class:"rounded-3xl"},{default:s(()=>o[5]||(o[5]=[t(" 登录 ")])),_:1},8,["loading"])]),_:1}),n("div",ue,[e(b,{depth:"3"},{default:s(()=>o[6]||(o[6]=[t(" 如您还没有账号？ ")])),_:1}),e(r,{text:"",type:"info"},{default:s(()=>o[7]||(o[7]=[t(" 创建账号 ")])),_:1})]),e(j,{dashed:""},{default:s(()=>[e(b,{depth:"3"},{default:s(()=>o[8]||(o[8]=[t(" 其他 ")])),_:1})]),_:1}),e(C,{justify:"center"},{default:s(()=>[e(r,{circle:""},{icon:s(()=>[e(l,null,{default:s(()=>[e(_(Y))]),_:1})]),_:1}),e(r,{circle:""},{icon:s(()=>[e(l,null,{default:s(()=>[e(_(Z))]),_:1})]),_:1}),e(r,{circle:""},{icon:s(()=>[e(l,null,{default:s(()=>[e(_(ee))]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])])]),_:1})]),_:1})])}}}),ge=oe(ce,[["__scopeId","data-v-1f8a95ec"]]);export{ge as default};
