import{l as h,m as v}from"./globalSearch-DWirDEfZ.js";import{d as b,r as y,u as S,a as D,c as k,b as e,w as t,e as n,o as C,f as I,t as q,g as B,m as N,i as V,p as $,h as x,j as F,_ as L}from"./index-FX23dEwE.js";import{u as R}from"./request-dCC5BMJA.js";const U=l=>($("data-v-4610376f"),l=l(),x(),l),j={class:"background"},z=U(()=>F("div",null,"用户登录",-1)),A=b({__name:"Login",setup(l){const a=y({username:"",password:""}),c=S(),p=D().query.redirect||"/",i=R();function _(){let s=new FormData;s.append("user",a.username),s.append("password",a.password),h(s).then(async()=>{var r;B(!0,a.username);const{data:o}=await v();(!i.mesh||!o.some(u=>u.id===i.mesh))&&(i.mesh=(r=o[0])==null?void 0:r.id),c.replace(p)}).catch(o=>{N.error(V.global.t("loginDomain.authFail"))})}return(s,o)=>{const r=n("a-row"),u=n("a-input"),m=n("a-form-item"),f=n("a-button"),g=n("a-form"),w=n("a-card");return C(),k("div",j,[e(w,{class:"login"},{default:t(()=>[e(r,{class:"title"},{default:t(()=>[z]),_:1}),e(r,null,{default:t(()=>[e(g,{layout:"vertical",model:a,ref:"login-form-ref"},{default:t(()=>[e(m,{class:"item",label:s.$t("loginDomain.username"),name:"username",rules:[{required:!0}]},{default:t(()=>[e(u,{type:"",value:a.username,"onUpdate:value":o[0]||(o[0]=d=>a.username=d)},null,8,["value"])]),_:1},8,["label"]),e(m,{class:"item",label:s.$t("loginDomain.password"),name:"password",rules:[{required:!0}]},{default:t(()=>[e(u,{type:"password",value:a.password,"onUpdate:value":o[1]||(o[1]=d=>a.password=d)},null,8,["value"])]),_:1},8,["label"]),e(m,{class:"item",label:""},{default:t(()=>[e(f,{onClick:_,size:"large",type:"primary",class:"login-btn"},{default:t(()=>[I(q(s.$t("loginDomain.login")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})]),_:1})])}}}),G=L(A,[["__scopeId","data-v-4610376f"]]);export{G as default};
