import{_ as E,u as F,a as U,b as j,r as m,c as x,w as z,E as y,d as c,o as f,g as _,i as s,F as R,G as T,t as b,k as o,f as l,l as d,m as A,n as H}from"./index-B2CLdTeJ.js";const I={class:"infra-shell"},J={class:"content"},K={class:"intro-card"},M={class:"service-grid"},P=["href"],X={class:"service-name"},D={class:"service-desc"},G={class:"login-card"},Q={class:"login-head"},Z={class:"form-note"},W={key:0},Y={key:1},$={__name:"index",setup(ee){const q=F(),g=U(),V=j(),N=[{name:"Nacos",desc:"配置与注册中心",href:"/nacos/"},{name:"Jenkins",desc:"持续集成",href:"/jenkins/"},{name:"XXL-JOB",desc:"任务调度中心",href:"/xxl-job-admin/"},{name:"Seata",desc:"事务控制台",href:"/seata/"}],n=m({username:"admin",password:"admin123",code:"",uuid:""}),p=m(!1),h=m(void 0),v=m(null),k=m(!1),L=x(()=>({username:[{required:!0,trigger:"blur",message:"请输入账号"}],password:[{required:!0,trigger:"blur",message:"请输入密码"}]})),O=x(()=>{var r;return((r=g.query)==null?void 0:r.registered)==="1"?"账号已创建成功，输入密码后可直接进入后台。":"请输入账号和密码进入后台管理。"});z(()=>g,r=>{var e,i,t;h.value=(e=r.query)==null?void 0:e.redirect,typeof((i=r.query)==null?void 0:i.username)=="string"&&r.query.username&&(n.value.username=r.query.username,n.value.password=""),((t=r.query)==null?void 0:t.registered)==="1"&&!k.value&&(y.success("注册成功，请登录系统"),k.value=!0)},{immediate:!0});function w(){if(!v.value){y.error("登录表单未初始化");return}v.value.validate(async r=>{if(!r){y.warning("请输入账号和密码");return}p.value=!0;try{await q.login(n.value);const e=g.query||{},i=Object.keys(e).reduce((t,u)=>(["redirect","registered","username"].includes(u)||(t[u]=e[u]),t),{});V.push({path:h.value||"/index",query:i})}catch(e){console.error("登录失败:",e)}finally{p.value=!1}})}return(r,e)=>{const i=c("svg-icon"),t=c("el-input"),u=c("el-form-item"),S=c("router-link"),B=c("el-button"),C=c("el-form");return f(),_("div",I,[e[9]||(e[9]=s("div",{class:"mesh"},[s("div",{class:"orb orb1"}),s("div",{class:"orb orb2"}),s("div",{class:"orb orb3"})],-1)),s("section",J,[s("div",K,[e[2]||(e[2]=s("p",{class:"eyebrow"},"ZOU MH INFRA",-1)),e[3]||(e[3]=s("h1",null,"基础服务入口保留，后台登录单独收口。",-1)),e[4]||(e[4]=s("p",{class:"summary"}," 登录页回到基础服务门户风格，保留统一视觉入口。 当前后台登录不使用验证码，只需要账号和密码。 ",-1)),s("div",M,[(f(),_(R,null,T(N,a=>s("a",{key:a.name,class:"service-card",href:a.href,target:"_blank",rel:"noreferrer"},[s("span",X,b(a.name),1),s("span",D,b(a.desc),1)],8,P)),64))])]),s("div",G,[s("div",Q,[e[5]||(e[5]=s("p",{class:"head-tag"},"CONTROL PANEL",-1)),e[6]||(e[6]=s("h2",null,"登录后台",-1)),s("p",null,b(O.value),1)]),o(C,{ref_key:"loginRef",ref:v,model:d(n),rules:L.value,class:"login-form"},{default:l(()=>[o(u,{prop:"username"},{default:l(()=>[o(t,{modelValue:d(n).username,"onUpdate:modelValue":e[0]||(e[0]=a=>d(n).username=a),type:"text",size:"large",autocomplete:"off",clearable:"",placeholder:"账号"},{prefix:l(()=>[o(i,{"icon-class":"user",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),o(u,{prop:"password"},{default:l(()=>[o(t,{modelValue:d(n).password,"onUpdate:modelValue":e[1]||(e[1]=a=>d(n).password=a),type:"password",size:"large",autocomplete:"off",placeholder:"密码","show-password":"",onKeyup:A(w,["enter"])},{prefix:l(()=>[o(i,{"icon-class":"password",class:"el-input__icon input-icon"})]),_:1},8,["modelValue"])]),_:1}),s("div",Z,[e[8]||(e[8]=s("span",null,"当前登录不校验验证码。",-1)),o(S,{class:"action-link",to:"/register"},{default:l(()=>[...e[7]||(e[7]=[H("去注册",-1)])]),_:1})]),o(u,null,{default:l(()=>[o(B,{loading:d(p),size:"large",type:"primary",class:"submit-btn",onClick:w},{default:l(()=>[d(p)?(f(),_("span",Y,"登录中...")):(f(),_("span",W,"进入后台"))]),_:1},8,["loading"])]),_:1})]),_:1},8,["model","rules"])])])])}}},re=E($,[["__scopeId","data-v-40b8e423"]]);export{re as default};
