import{u as e,a,G as s,o as r,e as o,f as l,g as t,w as m,I as n,r as d,af as u,p,i,h as c}from"./vendor.347ab8d9.js";import{_ as b,u as f}from"./index.d59ad4c2.js";import{a as g}from"./index.14ffc936.js";import"./request.dc2ccb4c.js";const w={setup(){const r=e(),o=a({username:"admin",password:"zxb666888"}),l=s(null);return f().clearTags(),{param:o,rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},login:l,submitForm:()=>{g(o).then((e=>{if(200!=e.status)return n.error("登录失败"),!1;n.success("登录成功"),localStorage.setItem("ms_username",o.username),localStorage.setItem("token",e.data.token),r.push("/"),console.log(e.data.token)}))}}}},_={class:"login-wrap"},v={class:"ms-login"},h=(e=>(p("data-v-bb77b560"),e=e(),i(),e))((()=>l("div",{class:"ms-title"},"后台管理系统",-1))),V={class:"login-btn"},k=c("登录");var x=b(w,[["render",function(e,a,s,n,p,i){const c=d("el-button"),b=d("el-input"),f=d("el-form-item"),g=d("el-form");return r(),o("div",_,[l("div",v,[h,t(g,{model:n.param,rules:n.rules,ref:"login","label-width":"0px",class:"ms-content"},{default:m((()=>[t(f,{prop:"username"},{default:m((()=>[t(b,{modelValue:n.param.username,"onUpdate:modelValue":a[0]||(a[0]=e=>n.param.username=e),placeholder:"username"},{prepend:m((()=>[t(c,{icon:"el-icon-user"})])),_:1},8,["modelValue"])])),_:1}),t(f,{prop:"password"},{default:m((()=>[t(b,{type:"password",placeholder:"password",modelValue:n.param.password,"onUpdate:modelValue":a[1]||(a[1]=e=>n.param.password=e),onKeyup:a[2]||(a[2]=u((e=>n.submitForm()),["enter"]))},{prepend:m((()=>[t(c,{icon:"el-icon-lock"})])),_:1},8,["modelValue"])])),_:1}),l("div",V,[t(c,{type:"primary",onClick:a[3]||(a[3]=e=>n.submitForm())},{default:m((()=>[k])),_:1})])])),_:1},8,["model","rules"])])])}],["__scopeId","data-v-bb77b560"]]);export{x as default};
