webpackJsonp([38],{G29q:function(t,e){},K31e:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});s("Fd2+");var o={data:function(){return{phoneNum:"",Sms:"",checked:!1,sqlPassword:"",userInfo:[],isU:""}},methods:{time:function(){if(this.now){var t=(new Date).getTime();return t-this.now>3e3&&(this.now=t,!0)}return this.now=(new Date).getTime(),!0},findPhone:function(){var t=this;if(""!==this.phoneNum)if(/^1\d{10}$/.test(this.phoneNum))if(""!==this.Sms){var e={phone:this.phoneNum};this.ajax.get(this.$store.state.api+"findPhone",e).then(function(e){if(e.data[0].length>0){if(0==e.data[0][0].state)return void t.$toast.fail("此账号已被屏蔽登录,请咨询管理员或者老师");2==e.data[0][0].type?t.isU=1:t.isU=2}else t.isU=!1;t.login(),console.log(e.data[0][0])}).catch(function(t){console.error(t)})}else this.$toast.fail("请输入密码");else this.$toast.fail("请输入正确的手机号");else this.$toast.fail("请输入手机号")},login:function(){var t=this;if(!this.time())return!1;var e=this,s=e.isU;if(1==s||2==s){var o=[{uname:this.phoneNum,upassword:this.Sms}];e.ajax.post(e.$store.state.api+"login",o).then(function(t){"1"==t.data.status?(e.$toast.success("登录成功"),e.userInfo=t.data[0][0],e.$cookies.set("login","1",-1),e.$cookies.set("userid",e.userInfo.userid,-1),e.$cookies.set("userInfo",e.userInfo,-1),e.$store.commit("update",["isLogin",!0]),e.$store.commit("update",["userInfo",e.userInfo]),e.$router.push("/")):e.$toast.fail("密码错误"),console.log(t.data)}).catch(function(e){t.$toast.fail("登录失败"),console.error(e)})}else this.$toast.fail("此账号还未注册请去注册")},goTo:function(t){this.$router.push(t)},goBack:function(){this.$router.push("/")}},created:function(){console.log(this.$route.query.username),"18676672877"==this.$route.query.username&&(this.phoneNum="18676672877",this.Sms="123456",this.findPhone())}},i={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"login-body"},[s("div",{staticClass:"login-head"},[s("van-icon",{staticClass:"pb_back",attrs:{name:"arrow-left",color:"#fff",size:"1.2rem"},on:{click:t.goBack}}),t._v(" "),s("span",[t._v("登录")])],1),t._v(" "),s("div",{staticClass:"solid_box"}),t._v(" "),s("div",{staticClass:"login_box"},[s("div",{staticClass:"login_head"}),t._v(" "),s("div",{staticClass:"login_body"},[s("div",{staticClass:"login_text_box login_phoneNum"},[s("i"),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.phoneNum,expression:"phoneNum"}],attrs:{type:"text",placeholder:"请输入手机号"},domProps:{value:t.phoneNum},on:{input:function(e){e.target.composing||(t.phoneNum=e.target.value)}}})]),t._v(" "),s("div",{staticClass:"login_text_box login_sms"},[s("i"),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.Sms,expression:"Sms"}],attrs:{type:"password",placeholder:"请输入密码"},domProps:{value:t.Sms},on:{input:function(e){e.target.composing||(t.Sms=e.target.value)}}})])]),t._v(" "),s("div",{staticClass:"login_button"},[s("button",{on:{click:t.findPhone}},[s("span",[t._v("登录")])]),t._v(" "),s("div",{staticClass:"login_register",on:{click:function(e){return t.goTo("/register")}}},[s("span",[t._v("立即注册")]),t._v(" "),s("van-icon",{attrs:{name:"arrow",color:"#9c9c9c",size:".75rem"}})],1)])])])},staticRenderFns:[]};var n=s("VU/8")(o,i,!1,function(t){s("G29q")},"data-v-57eb26da",null);e.default=n.exports}});
//# sourceMappingURL=38.f434ffd5b5f53bd22b8f.js.map