webpackJsonp([25],{"0HId":function(e,r,s){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=s("CCn6"),n=s("NC6I"),o=s.n(n),i=s("Nr3E"),a=s.n(i),l={data:function(){return{bgUrl:a.a,login:{username:"",password:""},loginRules:{username:[{required:!0,message:"请输入您的用户名",trigger:"blur"}],password:[{required:!0,message:"请输入您的密码",trigger:"blur"}]}}},mounted:function(){var e=this;document.onkeydown=function(r){var s=r||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(r){if(r){var s={username:e.login.username,password:o()(e.login.password)};Object(t._45)(s).then(function(r){e.$store.dispatch("setToken",r.token),e.$store.dispatch("setUserName",r.desc),e.$store.dispatch("setPermission",JSON.parse(r.roles.menu_ids)),window.location.href="/"})}})}}},u={render:function(){var e=this,r=e.$createElement,s=e._self._c||r;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(r){e.$set(e.login,"username",r)},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(r){e.$set(e.login,"password",r)},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 d=s("VU/8")(l,u,!1,function(e){s("IrvH")},"data-v-2da793b0",null);r.default=d.exports},IrvH:function(e,r){},Nr3E:function(e,r,s){e.exports=s.p+"static/img/skyBackground.d3b1524.png"}});