webpackJsonp([48],{"0HId":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=r("CCn6"),n=r("NC6I"),o=r.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 r=t||window.event;if(13===(r.keyCode||r.which||r.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 r={username:e.login.username,password:o()(e.login.password)};Object(s._146)(r).then(function(t){if(t.teacher_info){var r=JSON.stringify(t.teacher_info);localStorage.setItem("phoneNum",r)}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,r=e._self._c||t;return r("div",{staticClass:"login"},[r("div",{staticClass:"wrap-main"},[r("h1",{staticClass:"title"},[e._v("唱唱启蒙——后台管理系统")]),e._v(" "),r("el-form",{ref:"loginForm",attrs:{model:e.login,rules:e.loginRules}},[r("el-form-item",{attrs:{prop:"username"}},[r("el-input",{attrs:{placeholder:"用户名"},model:{value:e.login.username,callback:function(t){e.$set(e.login,"username",t)},expression:"login.username"}})],1),e._v(" "),r("el-form-item",{attrs:{prop:"password"}},[r("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(" "),r("el-form-item",[r("el-button",{staticClass:"btn",attrs:{size:"medium",type:"primary"},on:{click:e.submitForm}},[e._v("登录")]),e._v(" "),r("router-link",{staticClass:"fr",attrs:{to:{name:"register"}}},[e._v("\n          班主任注册入口\n        ")])],1)],1)],1)])},staticRenderFns:[]};var l=r("VU/8")(i,a,!1,function(e){r("gX0k")},"data-v-a8444c4a",null);t.default=l.exports},gX0k:function(e,t){}});