webpackJsonp([31],{"0HId":function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var r=t("CCn6"),n=t("NC6I"),o=t.n(n),i={data:function(){return{login:{username:"",password:""},loginRules:{username:[{required:!0,message:"请输入您的用户名",trigger:"blur"}],password:[{required:!0,message:"请输入您的密码",trigger:"blur"}]}}},mounted:function(){var e=this;document.onkeydown=function(s){var t=s||window.event;if(13===(t.keyCode||t.which||t.charCode)&&"login"===e.$route.name)return e.submitForm(),!1;return!0}},methods:{submitForm:function(){var e=this;this.$refs.loginForm.validate(function(s){if(s){var t={username:e.login.username,password:o()(e.login.password)};Object(r._52)(t).then(function(s){e.$store.dispatch("setToken",s.token),e.$store.dispatch("setUserName",s.desc),e.$store.dispatch("setPermission",JSON.parse(s.roles.menu_ids)),window.location.href="/"})}})}}},a={render:function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("div",{staticClass:"login"},[t("div",{staticClass:"wrap-main"},[t("h1",{staticClass:"title"},[e._v("唱唱启蒙——后台管理系统")]),e._v(" "),t("el-form",{ref:"loginForm",attrs:{model:e.login,rules:e.loginRules}},[t("el-form-item",{attrs:{prop:"username"}},[t("el-input",{attrs:{placeholder:"用户名"},model:{value:e.login.username,callback:function(s){e.$set(e.login,"username",s)},expression:"login.username"}})],1),e._v(" "),t("el-form-item",{attrs:{prop:"password"}},[t("el-input",{attrs:{type:"password",placeholder:"密码"},model:{value:e.login.password,callback:function(s){e.$set(e.login,"password",s)},expression:"login.password"}})],1),e._v(" "),t("el-form-item",[t("el-button",{staticClass:"btn",attrs:{size:"medium",type:"primary"},on:{click:e.submitForm}},[e._v("登陆")])],1)],1)],1)])},staticRenderFns:[]};var l=t("VU/8")(i,a,!1,function(e){t("TrQ5")},"data-v-53d08e97",null);s.default=l.exports},TrQ5:function(e,s){}});