import{d as L,r as f,u as R,bz as S,a as B,b as E,e as I,f as U,c as z,o as O,w as o,j as s,i,_ as q,k as A,N as M,l as y,P as V,m as j,L as F,n as G,p as m,B as K,R as D,t as T,v as H}from"./index-9PRMimni.js";const J={class:"mb-6 default-color"},Q={class:"flex justify-between"},W={class:"flex-initial"},X={class:"flex-initial order-last"},Y=L({__name:"PlusLoginForm",setup(Z){const g=f(),a=R(),c=f(!1),v=f(!0),h=S.BASE_LOGIN_NAME,n=B({username:"admin",password:"123456"}),N={username:{required:!0,message:"请输入用户名",trigger:"blur"},password:{required:!0,message:"请输入密码",trigger:"blur"}},C=E(),w=I(),k=U(),b=x=>{x.preventDefault(),g.value.validate(async e=>{if(e)a.error("请填写完整信息");else{const{username:l,password:u}=n;a.loading("登录中..."),c.value=!0;const t={username:l,password:u};try{const{code:_,message:d}=await C.login(t);if(a.destroyAll(),_==D.SUCCESS){const p=decodeURIComponent(k.query?.redirect||"/");a.success("登录成功，即将进入系统"),k.name===h?w.replace("/"):w.replace(p)}else a.info(d||"登录失败")}finally{c.value=!1}}})};function P(){a.warning("忘记密码暂未实现")}return(x,e)=>{const l=M,u=A,t=q,_=G,d=K,p=T;return O(),z(p,{ref_key:"formRef",ref:g,"show-label":!1,"show-require-mark":!1,size:"large",model:n,rules:N,class:"plus-login-form"},{default:o(()=>[s(t,{path:"username"},{default:o(()=>[s(u,{value:n.username,"onUpdate:value":e[0]||(e[0]=r=>n.username=r),placeholder:"请输入用户名",class:"rounded-lg"},{prefix:o(()=>[s(l,{size:"18",color:"#808695"},{default:o(()=>[s(y(V))]),_:1})]),_:1},8,["value"])]),_:1}),s(t,{path:"password"},{default:o(()=>[s(u,{value:n.password,"onUpdate:value":e[1]||(e[1]=r=>n.password=r),type:"password",showPasswordOn:"click",placeholder:"请输入密码",onKeyup:j(b,["enter"]),class:"rounded-lg"},{prefix:o(()=>[s(l,{size:"18",color:"#808695"},{default:o(()=>[s(y(F))]),_:1})]),_:1},8,["value"])]),_:1}),i("div",J,[i("div",Q,[i("div",W,[s(_,{checked:v.value,"onUpdate:checked":e[2]||(e[2]=r=>v.value=r)},{default:o(()=>e[3]||(e[3]=[m("自动登录")])),_:1},8,["checked"])]),i("div",X,[s(d,{text:"",class:"forget",onClick:P},{default:o(()=>e[4]||(e[4]=[m(" 忘记密码? ")])),_:1})])])]),s(t,{"show-label":!1},{default:o(()=>[s(d,{type:"primary",onClick:b,size:"large",loading:c.value,block:"",class:"rounded-lg"},{default:o(()=>e[5]||(e[5]=[m(" 登录 ")])),_:1},8,["loading"])]),_:1})]),_:1},8,["model"])}}}),ee=H(Y,[["__scopeId","data-v-0403268d"]]);export{ee as default};
