import{d as V,u as k,o as h,c as C,a,b as o,w as l,e as B,r as n,f as E,g as u,h as L,i as N,l as R,j as U,k as f,m as q,E as _,_ as z}from"./index-DIl-pxgT.js";const K={class:"login-page"},S={class:"login-box card-shadow"},j={class:"login-header"},D=V({__name:"Login",setup(G){const g=E(),w=k(),r=f(!1),p=f(),s=q({username:"admin",password:"admin123"}),v={username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]};async function c(){var e;if(await((e=p.value)==null?void 0:e.validate().catch(()=>!1))){r.value=!0;try{await w.login(s.username,s.password),_.success("登录成功"),g.push("/")}catch(t){_.error((t==null?void 0:t.message)||"登录失败")}finally{r.value=!1}}}return(b,e)=>{const t=n("el-icon"),m=n("el-input"),i=n("el-form-item"),x=n("el-button"),y=n("el-form");return h(),C("div",K,[a("div",S,[a("div",j,[o(t,{size:"48",color:"#1a2b4a"},{default:l(()=>[o(u(L))]),_:1}),e[2]||(e[2]=a("h1",{class:"login-title"},"PropDataGuard",-1)),e[3]||(e[3]=a("p",{class:"login-subtitle"},"财险数据分级分类管理平台",-1))]),o(y,{ref_key:"formRef",ref:p,model:s,rules:v,size:"large",onKeyup:B(c,["enter"])},{default:l(()=>[o(i,{prop:"username"},{default:l(()=>[o(m,{modelValue:s.username,"onUpdate:modelValue":e[0]||(e[0]=d=>s.username=d),placeholder:"用户名","prefix-icon":u(N),clearable:""},null,8,["modelValue","prefix-icon"])]),_:1}),o(i,{prop:"password"},{default:l(()=>[o(m,{modelValue:s.password,"onUpdate:modelValue":e[1]||(e[1]=d=>s.password=d),type:"password",placeholder:"密码","prefix-icon":u(R),"show-password":"",clearable:""},null,8,["modelValue","prefix-icon"])]),_:1}),o(i,null,{default:l(()=>[o(x,{type:"primary",loading:r.value,class:"login-btn",onClick:c},{default:l(()=>[...e[4]||(e[4]=[U(" 登录 ",-1)])]),_:1},8,["loading"])]),_:1})]),_:1},8,["model"]),e[5]||(e[5]=a("div",{class:"login-footer"},[a("p",null,"默认管理员：admin / admin123")],-1))])])}}}),M=z(D,[["__scopeId","data-v-8c2e034d"]]);export{M as default};
//# sourceMappingURL=Login-Blg9KWw-.js.map
