import{at as C,by as n,bK as E,ck as x,an as K,ak as d,Y as B,ap as w,bO as S,bT as m,aq as e,ct as a,p as U,g as F,a1 as L,q as N,s as R,cx as _,r as T,cl as z,bb as A,cf as D,ce as G,bs as O,_ as Y}from"./index-BVAEVuZQ.js";const j={class:"login-page-contaienr"},H={class:"content"},J={class:"title"},M=["src"],P=C({__name:"index",setup(Q){const V="GIS Studio",f=D(),g=G(),u=n(!1),v=n(""),o=n({username:"",password:"",code:"",captcha_id:""}),y={username:{required:!0,trigger:"blur",message:"请输入用户名"},password:{required:!0,trigger:"blur",message:"请输入密码"},code:{required:!0,trigger:"blur",message:"请输入验证码"}},h=n(),{isLogin:k}=E(x()),r=()=>{h.value?.validate(s=>{s&&(u.value=!0,x().doLogin(o.value).then(()=>{if(k.value=!0,g.query.redirect){f.push(g.query.redirect);return}f.push("/")}).catch(()=>{i()}).finally(()=>{u.value=!1}))})},i=()=>{L.auth.getAuthCode().then(s=>{o.value.captcha_id=s.data.data?.captcha_id||"",v.value=s.data.data?.image||""})};return i(),(s,t)=>{const b=T,c=R,p=N,q=U,I=F;return O(),K("div",j,[d("div",H,[d("div",J,[t[3]||(t[3]=d("img",{src:B,width:"28px",height:"28px",alt:""},null,-1)),w(" "+S(m(V)),1)]),e(q,{model:o.value,rules:y,ref_key:"formIns",ref:h,"label-position":"left","hide-required-asterisk":""},{default:a(()=>[e(p,{label:"",prop:"username"},{default:a(()=>[e(c,{modelValue:o.value.username,"onUpdate:modelValue":t[0]||(t[0]=l=>o.value.username=l),onKeydown:_(r,["enter"]),placeholder:"用户名",autocomplete:"username"},{prefix:a(()=>[e(b,{size:"18px"},{default:a(()=>[e(m(z))]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(p,{label:"",prop:"password"},{default:a(()=>[e(c,{modelValue:o.value.password,"onUpdate:modelValue":t[1]||(t[1]=l=>o.value.password=l),type:"password",onKeydown:_(r,["enter"]),placeholder:"密码",autocomplete:"current-password"},{prefix:a(()=>[e(b,{size:"18px"},{default:a(()=>[e(m(A))]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(p,{label:"",prop:"code"},{default:a(()=>[e(c,{modelValue:o.value.code,"onUpdate:modelValue":t[2]||(t[2]=l=>o.value.code=l),onKeydown:_(r,["enter"]),placeholder:"验证码"},{append:a(()=>[d("img",{width:"120px",onClick:i,src:v.value,alt:""},null,8,M)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"]),e(I,{onClick:r,loading:u.value},{default:a(()=>[...t[4]||(t[4]=[w("登录",-1)])]),_:1},8,["loading"])])])}}}),X=Y(P,[["__scopeId","data-v-c4413c1e"]]);export{X as default};
