import{d as V,B as k,u as x,h as i,Y as C,L as $,Z as q,r as l,o as B,f as I,w as n,a as g,t as h,b as t,k as d,$ as R,a0 as A,a1 as F,l as K,a2 as L,s as N,_ as U}from"./index.e3896b23.js";const S={class:"login-title"},D=["src"],M=V({__name:"account",setup(T){const y=k(),{t:u}=x(),m=i(),_=i(),a=C({username:"admin",password:"admin",key:"",captcha:""}),b=i({username:[{required:!0,message:u("required"),trigger:"blur"}],password:[{required:!0,message:u("required"),trigger:"blur"}],captcha:[{required:!0,message:u("required"),trigger:"blur"}]});$(()=>{p()});const p=async()=>{const{data:e}=await q();a.key=e.key,_.value=e.image},f=()=>{m.value.validate(e=>{if(!e)return!1;N.userStore.accountLoginAction(a).then(()=>{y.push({path:"/home"})}).catch(()=>{p()})})};return(e,o)=>{const c=l("el-input"),r=l("el-form-item"),v=l("el-button"),w=l("el-form");return B(),I(w,{ref_key:"loginFormRef",ref:m,model:a,rules:b.value,onKeyup:L(f,["enter"])},{default:n(()=>[g("div",S,h(e.$t("app.signIn")),1),t(r,{prop:"username"},{default:n(()=>[t(c,{modelValue:a.username,"onUpdate:modelValue":o[0]||(o[0]=s=>a.username=s),"prefix-icon":d(R),placeholder:e.$t("app.username")},null,8,["modelValue","prefix-icon","placeholder"])]),_:1}),t(r,{prop:"password"},{default:n(()=>[t(c,{modelValue:a.password,"onUpdate:modelValue":o[1]||(o[1]=s=>a.password=s),"prefix-icon":d(A),"show-password":"",placeholder:e.$t("app.password")},null,8,["modelValue","prefix-icon","placeholder"])]),_:1}),t(r,{prop:"captcha",class:"login-captcha"},{default:n(()=>[t(c,{modelValue:a.captcha,"onUpdate:modelValue":o[2]||(o[2]=s=>a.captcha=s),placeholder:e.$t("app.captcha"),"prefix-icon":d(F)},null,8,["modelValue","placeholder","prefix-icon"]),g("img",{src:_.value,onClick:p},null,8,D)]),_:1}),t(r,{class:"login-button"},{default:n(()=>[t(v,{type:"primary",onClick:o[3]||(o[3]=s=>f())},{default:n(()=>[K(h(e.$t("app.signIn")),1)]),_:1})]),_:1})]),_:1},8,["model","rules","onKeyup"])}}});const Z=U(M,[["__scopeId","data-v-b7bb6692"]]);export{Z as default};
