webpackJsonp([54],{"0HId":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s("CCn6"),n=s("NC6I"),o=s.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(t){var s=t||window.event;if(13===(s.keyCode||s.which||s.charCode)&&"login"===e.$route.name)return e.submitForm(),!1;return!0}},methods:{submitForm:function(){var e=this;this.$refs.loginForm.validate(function(t){if(t){var s={username:e.login.username,password:o()(e.login.password)};Object(r._116)(s).then(function(t){if(t.teacher_info){var s=JSON.stringify(t.teacher_info);localStorage.setItem("phoneNum",s)}else localStorage.setItem("phoneNum","");e.$store.dispatch("setToken",t.token),e.$store.dispatch("setUserName",t.desc),e.$store.dispatch("setPermission",JSON.parse(t.roles.menu_ids)),window.location.href="/"})}})},goRegister:function(){this.$router.push({name:"register"})}}},a={render:function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"login"},[s("div",{staticClass:"wrap-main"},[s("h1",{staticClass:"title"},[e._v("唱唱启蒙——后台管理系统")]),e._v(" "),s("el-form",{ref:"loginForm",attrs:{model:e.login,rules:e.loginRules}},[s("el-form-item",{attrs:{prop:"username"}},[s("el-input",{attrs:{placeholder:"用户名"},model:{value:e.login.username,callback:function(t){e.$set(e.login,"username",t)},expression:"login.username"}})],1),e._v(" "),s("el-form-item",{attrs:{prop:"password"}},[s("el-input",{attrs:{type:"password",placeholder:"密码"},model:{value:e.login.password,callback:function(t){e.$set(e.login,"password",t)},expression:"login.password"}})],1),e._v(" "),s("el-form-item",[s("el-button",{staticClass:"btn",attrs:{size:"medium",type:"primary"},on:{click:e.submitForm}},[e._v("登陆")])],1)],1)],1)])},staticRenderFns:[]};var l=s("VU/8")(i,a,!1,function(e){s("SaPm")},"data-v-1cdd4cdc",null);t.default=l.exports},SaPm:function(e,t){}});