import{r as g,d as f,b as w,f as r,a as b,c as k,g as o,w as a,i as v,t as x,E as V}from"./index-ad591d72.js";import{l as y}from"./index-dc51eeee.js";import{_ as h}from"./_plugin-vue_export-helper-c27b6911.js";import"./axios-4a70c6fc.js";const U={class:"container shadow"},D={__name:"login",setup(P){const n=g(),l=f({Username:"",Password:""}),u=w(),d=()=>{n.value.validate(t=>{if(t)y(l).then(e=>{if(console.log("登录成功",e),e.error){V.error(e.error);return}e.token&&(localStorage.setItem("token",e.token),u.replace("/index/tools/clock"))});else return!1})};return(t,e)=>{const i=r("el-input"),m=r("el-form-item"),c=r("el-button"),_=r("el-row"),p=r("el-form");return b(),k("div",U,[o(p,{ref_key:"loginForm",ref:n,model:l,"label-width":"80px",style:{"max-width":"400px",margin:"0 auto"}},{default:a(()=>[o(m,{label:t.$t("clock.userDialog.username"),prop:"Username",rules:[{required:!0,message:"",trigger:"blur"}]},{default:a(()=>[o(i,{modelValue:l.Username,"onUpdate:modelValue":e[0]||(e[0]=s=>l.Username=s),placeholder:""},null,8,["modelValue"])]),_:1},8,["label"]),o(m,{label:t.$t("clock.userDialog.password"),prop:"Password",rules:[{required:!0,message:"",trigger:"blur"}]},{default:a(()=>[o(i,{"show-password":"",type:"password",modelValue:l.Password,"onUpdate:modelValue":e[1]||(e[1]=s=>l.Password=s),placeholder:""},null,8,["modelValue"])]),_:1},8,["label"]),o(_,null,{default:a(()=>[o(c,{style:{margin:"10px auto"},onClick:d},{default:a(()=>[v(x(t.$t("clock.login")),1)]),_:1})]),_:1})]),_:1},8,["model"])])}}},B=h(D,[["__scopeId","data-v-a91cb329"]]);export{B as default};
