2 lines
1.7 KiB
JavaScript
2 lines
1.7 KiB
JavaScript
import{A as U,_ as I,u as R,r as c,o as S,b as s,c as b,h as L,e as v,f as e,w as t,p as m,g as B,y as C,z as E,D as K,E as w}from"./index-CWN5yz9-.js";function N(a){return U.post("/login/account",a)}const M=a=>(C("data-v-aaf16e07"),a=a(),E(),a),T={class:"body"},q={class:"login"},z=M(()=>v("div",{class:"title"},"里海收银系统 - 登录",-1)),A={__name:"index",setup(a){const d=R(),y=K(),h=c(null),p=c(null),n=c({account:"",password:"",terminal:1}),_=()=>{if(!n.value.account)return w({message:"请填写账号",type:"error"});if(!n.value.password)return w({message:"请填写密码",type:"error"});N(n.value).then(l=>{var o;(o=l.data)!=null&&o.token&&(d.setToken(l.data.token),d.setUserInfo(l.data),y.push("/"))}).catch(l=>{})};return S(()=>{}),(l,o)=>{const k=s("User"),f=s("el-icon"),i=s("el-input"),u=s("el-form-item"),g=s("Lock"),x=s("el-button"),V=s("el-form");return b(),L("div",T,[v("div",q,[z,e(V,null,{default:t(()=>[e(u,null,{default:t(()=>[e(i,{ref_key:"accRef",ref:h,modelValue:n.value.account,"onUpdate:modelValue":o[0]||(o[0]=r=>n.value.account=r),placeholder:"请输入账号",autofocus:!0,onKeydown:o[1]||(o[1]=m(r=>p.value.focus(),["enter"]))},{prefix:t(()=>[e(f,null,{default:t(()=>[e(k)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(u,null,{default:t(()=>[e(i,{ref_key:"pwdRef",ref:p,modelValue:n.value.password,"onUpdate:modelValue":o[2]||(o[2]=r=>n.value.password=r),type:"password",placeholder:"请输入密码","show-password":"",onKeydown:m(_,["enter"])},{prefix:t(()=>[e(f,null,{default:t(()=>[e(g)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(u,null,{default:t(()=>[e(x,{style:{width:"100%"},type:"primary",onClick:_},{default:t(()=>[B("登录")]),_:1})]),_:1})]),_:1})])])}}},$=I(A,[["__scopeId","data-v-aaf16e07"]]);export{$ as default};
|