webpackJsonp([69],{"90Fj":function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=s("CCn6"),o=s("NC6I"),n=s.n(o),l={data:function(){return{login:{username:"",password:""},loginRules:{username:[{required:!0,message:"请输入您的用户名",trigger:"blur"}],password:[{required:!0,message:"请输入您的密码",trigger:"blur"}]},texT:"获取验证码",disable:!1}},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:{getCode:function(){var e=this;if(this.login.take_class_mobile){this.disable=!0;var t=10;Object(i._145)({mobile:this.login.take_class_mobile}).then(function(s){e.texT="10s";var i=setInterval(function(){t--,e.texT=t+"s"},1e3);setTimeout(function(){e.disable=!1,clearInterval(i),e.texT="获取验证码"},1e4)})}else this.$message("请填写手机号")},submitForm:function(){var e=this;this.$refs.loginForm.validate(function(t){if(t){var s={username:e.login.username,password:n()(e.login.password),take_class_mobile:e.login.take_class_mobile,id_number:e.login.id_number,verify_code:e.login.verify_code};Object(i._148)(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="/"})}})}}},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:"take_class_mobile"}},[s("el-input",{attrs:{placeholder:"带班手机号"},model:{value:e.login.take_class_mobile,callback:function(t){e.$set(e.login,"take_class_mobile",t)},expression:"login.take_class_mobile"}})],1),e._v(" "),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",{attrs:{prop:"id_number"}},[s("el-input",{attrs:{maxlength:"18",placeholder:"身份证号"},model:{value:e.login.id_number,callback:function(t){e.$set(e.login,"id_number",t)},expression:"login.id_number"}})],1),e._v(" "),s("el-form-item",{attrs:{prop:"verify_code"}},[s("el-input",{attrs:{placeholder:"验证码"},model:{value:e.login.verify_code,callback:function(t){e.$set(e.login,"verify_code",t)},expression:"login.verify_code"}})],1),e._v(" "),s("el-form-item",[s("el-button",{staticClass:"btn",attrs:{size:"medium",type:"success"},on:{click:e.submitForm}},[e._v("注册")]),e._v(" "),s("el-button",{staticClass:"btn code",staticStyle:{"margin-top":"20px"},attrs:{size:"medium",type:"primary",disabled:e.disable,plain:""},on:{click:e.getCode}},[e._v(e._s(e.texT))])],1)],1)],1)])},staticRenderFns:[]};var r=s("VU/8")(l,a,!1,function(e){s("iSJe")},"data-v-1ab60b64",null);t.default=r.exports},iSJe:function(e,t){}});