cashier-ERP/dist/assets/index-DVwXlSuN.js

2 lines
1.6 KiB
JavaScript
Raw Normal View History

2024-04-09 17:19:32 +08:00
import{_ as x,x as V,r as y,o as k,b as n,c as U,h as I,e as i,f as e,w as o,g as S,s as b,u as L,z as B,E as u,G as C,H as E}from"./index-u0hj8LVS.js";const N=l=>(b("data-v-00c0f4e8"),l=l(),L(),l),M={class:"body"},T={class:"login"},z=N(()=>i("div",{class:"title"},"里海收银系统 - 登录",-1)),G={__name:"index",setup(l){const d=V(),m=B(),t=y({account:"",password:"",key:"",captchaVerification:"",code:""}),f=()=>{if(!t.value.account)return u({message:"请填写账号",type:"error"});if(!t.value.password)return u({message:"请填写密码",type:"error"});C(t.value).then(a=>{console.log(a),a.data&&(d.setToken(a.data.token),E().then(({data:s})=>{if(!s.service)return u({message:"请联系管理员开通服务",type:"error"});d.setUserInfo(s),m.push("/")}))}).catch(a=>{})};return k(()=>{}),(a,s)=>{const v=n("User"),_=n("el-icon"),p=n("el-input"),c=n("el-form-item"),h=n("Lock"),w=n("el-button"),g=n("el-form");return U(),I("div",M,[i("div",T,[z,e(g,null,{default:o(()=>[e(c,null,{default:o(()=>[e(p,{modelValue:t.value.account,"onUpdate:modelValue":s[0]||(s[0]=r=>t.value.account=r),placeholder:"请输入账号"},{prefix:o(()=>[e(_,null,{default:o(()=>[e(v)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:o(()=>[e(p,{modelValue:t.value.password,"onUpdate:modelValue":s[1]||(s[1]=r=>t.value.password=r),type:"password",placeholder:"请输入密码","show-password":""},{prefix:o(()=>[e(_,null,{default:o(()=>[e(h)]),_:1})]),_:1},8,["modelValue"])]),_:1}),e(c,null,{default:o(()=>[e(w,{style:{width:"100%"},type:"primary",onClick:f},{default:o(()=>[S("登录")]),_:1})]),_:1})]),_:1})])])}}},R=x(G,[["__scopeId","data-v-00c0f4e8"]]);export{R as default};