(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3bcfd210"],{a55b:function(e,t,o){"use strict";o.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"backimg"},[t("div",{staticClass:"sign"},[t("span",{staticClass:"title"},[e._v("Hi 欢迎使用")]),e._m(0),t("p",{staticClass:"title-1"},[e._v("登录")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],attrs:{type:"text",placeholder:"请输入用户名"},domProps:{value:e.form.name},on:{input:function(t){t.target.composing||e.$set(e.form,"name",t.target.value)}}}),t("br"),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.password,expression:"form.password"}],attrs:{type:"password",placeholder:"请输入密码"},domProps:{value:e.form.password},on:{input:function(t){t.target.composing||e.$set(e.form,"password",t.target.value)}}}),t("br"),t("el-checkbox",{model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},[e._v("记住密码")]),t("br"),t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.Login()}}},[e._v("登录")])],1)])},a=[function(){var e=this,t=e._self._c;return t("p",{staticClass:"manage"},[t("img",{attrs:{src:o("c663"),alt:""}}),t("span",[e._v("ERP管理系统")])])}],r=o("4ff3"),i=o.n(r),n={data(){return{checked:!1,form:{name:"",password:""}}},mounted(){this.getCookie()},methods:{Login(){!0===this.checked?this.setCookie(this.form.name,this.form.password,!0,7):this.clearCookie(),""===this.form.name||""===this.form.password?this.$message({message:"账号或密码不能为空",type:"error"}):i.a.post("/api/auth/login",this.form).then(e=>{let t=e.data;t.error&&(this.$message({message:"账号或密码错误,请重新输入",type:"error"}),this.form.name="",this.form.password="",this.checked=!1),t.token&&(this.form={},localStorage.setItem("token",t.token),this.$message({message:"成功登录,欢迎来到后台管理系统",type:"success"}),this.$router.push("/GOODS_LIST"))})},setCookie(e,t,o,s){const a=new Date;a.setTime(a.getTime()+864e5*s),window.document.cookie="name="+e+";path=/;expires="+a.toGMTString(),window.document.cookie="password="+t+";path=/;expires="+a.toGMTString(),window.document.cookie="state="+o+";path=/;expires="+a.toGMTString()},getCookie(){if(document.cookie.length>0){const e=document.cookie.split("; ");for(let t=0;t