webpackJsonp([43],{"90Fj":function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});t("CCn6");var r=t("NC6I"),n=t.n(r),o={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:n()(e.login.password)};loginApi(t).then(function(s){if(s.teacher_info){var t=JSON.stringify(s.teacher_info);localStorage.setItem("phoneNum",t)}else localStorage.setItem("phoneNum","");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="/"})}})}}},i={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:"success"},on:{click:e.submitForm}},[e._v("注册")])],1)],1)],1)])},staticRenderFns:[]};var a=t("VU/8")(o,i,!1,function(e){t("s1Ce")},"data-v-c2c4dcd4",null);s.default=a.exports},s1Ce:function(e,s){}});