import{u as m,r as p,o as r,c as l,a as s,b as _,w as i,v as u,_ as f,m as n,A as g,D as h}from"./index.js";import{d as v,s as w}from"./utils.js";const y={id:"LoginIndex"},k={class:"logo-box"},x={key:0,class:"logo",src:f,alt:""},b={class:"form-signin"},L=s("h1",{class:"form-title"},"Please Login",-1),P={class:"form-group"},C={class:"form-group"},U=s("div",{class:"copyright"},"\xA9 2016-2023 All Rights Reserved",-1),D={__name:"login",setup(V){const d=m(),t=p({username:"",password:""});function c(){let o=v(t.value);if(!o.username)return n.warning("Please input Username");if(!o.password)return n.warning("Please input Password");let e=w(o.username+o.password);g.Common.login({token:e}).then(()=>{d.push("/information"),h.setToken(e)}).catch(()=>{n.error("Login failure")})}return(o,e)=>(r(),l("div",y,[s("div",k,[o.$config.show_logo?(r(),l("img",x)):_("",!0)]),s("form",b,[L,s("div",P,[i(s("input",{type:"text",autofocus:"","onUpdate:modelValue":e[0]||(e[0]=a=>t.value.username=a),class:"form-control",placeholder:"Username"},null,512),[[u,t.value.username]])]),s("div",C,[i(s("input",{type:"password","onUpdate:modelValue":e[1]||(e[1]=a=>t.value.password=a),class:"form-control",placeholder:"Password"},null,512),[[u,t.value.password]])]),s("button",{type:"button",class:"form-btn white",onClick:c},"Login")]),U]))}};export{D as default};
