var g=(w,c,r)=>new Promise((d,n)=>{var t=s=>{try{u(r.next(s))}catch(e){n(e)}},f=s=>{try{u(r.throw(s))}catch(e){n(e)}},u=s=>s.done?d(s.value):Promise.resolve(s.value).then(t,f);u((r=r.apply(w,c)).next())});import{d as h,r as y,a as k,o as C,c as O,b,e as l,w as i,l as P,f as _,g as R,h as x,i as $,u as z}from"./index.2f2d2ba5.js";const B="/assets/login-logo-title.4cc9ae43.png";const D={class:"login"},F={class:"form"},N=b("img",{src:B,alt:"",class:"logo-title"},null,-1),j=x(" \u767B\u5F55 "),q=x("\u91CD\u7F6E"),A=h({name:"login"}),T=Object.assign(A,{setup(w){const{proxy:c}=$(),r=z(),d=y(!1),n=y(),t=k({loginPlatform:"PC_PLATFORM",username:void 0,password:void 0}),f={username:[{required:!0,message:"\u8BF7\u586B\u5199\u7528\u6237\u540D",trigger:"blur"}],password:[{required:!0,message:"\u8BF7\u586B\u5199\u5BC6\u7801",trigger:"blur"}]},u=e=>g(this,null,function*(){!e||(yield e.validate(o=>g(this,null,function*(){if(o){d.value=!0;const m=new FormData;for(const a in t)Object.hasOwnProperty.call(t,a)&&m.append(a,t[a]);try{yield P(m),c.$message.success("\u767B\u5F55\u6210\u529F\uFF01"),yield r.replace({path:"/home",replace:!0}),c.$message.closeAll()}catch(a){console.log(a)}d.value=!1}})))}),s=e=>{!e||e.resetFields()};return C(()=>{window.addEventListener("keydown",e=>{e.code==="Enter"&&(e.preventDefault(),e.cancel=!0,u(n.value))})}),(e,o)=>{const m=_("el-input"),a=_("el-form-item"),v=_("el-button"),V=_("el-form");return R(),O("div",D,[b("div",F,[N,l(V,{ref_key:"formRef",ref:n,"label-position":"top",model:t,rules:f,size:"large"},{default:i(()=>[l(a,{label:"\u7528\u6237\u540D",prop:"username",style:{"margin-bottom":"24px"}},{default:i(()=>[l(m,{modelValue:t.username,"onUpdate:modelValue":o[0]||(o[0]=p=>t.username=p),placeholder:"\u8BF7\u586B\u5199\u7528\u6237\u540D"},null,8,["modelValue"])]),_:1}),l(a,{label:"\u5BC6\u7801",prop:"password",style:{"margin-bottom":"40px"}},{default:i(()=>[l(m,{modelValue:t.password,"onUpdate:modelValue":o[1]||(o[1]=p=>t.password=p),placeholder:"\u8BF7\u586B\u5199\u5BC6\u7801",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),l(a,{class:"btn"},{default:i(()=>[l(v,{loading:d.value,type:"primary",size:"default",class:"mr-64",onClick:o[2]||(o[2]=p=>u(n.value))},{default:i(()=>[j]),_:1},8,["loading"]),l(v,{size:"default",onClick:o[3]||(o[3]=p=>s(n.value))},{default:i(()=>[q]),_:1})]),_:1})]),_:1},8,["model"])])])}}});export{T as default};
