AppLogin.08bfe3f3.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["AppLogin"],{"39c7":function(e,t,n){"use strict";var o=n("cacf"),i=n.n(o);i.a},6354:function(e,t,n){"use strict";var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("van-popup",{staticClass:"imgCodePopup",attrs:{"close-on-click-overlay":!1,closeable:"","close-icon":"close"},on:{close:e.onClose},model:{value:e.showImgCode,callback:function(t){e.showImgCode=t},expression:"showImgCode"}},[n("div",{staticClass:"imgCode"},[n("p",{staticClass:"codeTitle"},[e._v("输入图形验证码")]),n("van-row",{attrs:{type:"flex"}},[n("van-col",{attrs:{span:"14"}},[n("van-field",{staticStyle:{background:"#F4F4F4",padding:".12rem .16rem"},attrs:{placeholder:"请输入验证码"},model:{value:e.code,callback:function(t){e.code=t},expression:"code"}})],1),n("van-col",{staticClass:"img",attrs:{span:"10"}},[n("van-image",{attrs:{src:e.identifyingCode},on:{click:function(t){return e.updateIdentifyingCode(!0)}},scopedSlots:e._u([{key:"loading",fn:function(){return[n("van-loading",{attrs:{type:"spinner",size:"20"}})]},proxy:!0}])})],1)],1),n("van-row",[n("van-col",{attrs:{span:"14"}}),n("van-col",{attrs:{span:"10"}},[n("span",{staticClass:"imgChange",on:{click:function(t){return e.updateIdentifyingCode(!0)}}},[e._v("看不清?换一换")])])],1)],1)])},i=[],s=n("a34a"),a=n.n(s),r=n("b562");function c(e,t,n,o,i,s,a){try{var r=e[s](a),c=r.value}catch(u){return void n(u)}r.done?t(c):Promise.resolve(c).then(o,i)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function a(e){c(s,o,i,a,r,"next",e)}function r(e){c(s,o,i,a,r,"throw",e)}a(void 0)})}}var p={name:"imgCode",props:{value:Boolean,phone:String||Number},data:function(){var e=window.location.origin;return{showImgCode:this.value,identifyingCode:e+"/api-teacher/code/getLoginImage?phone="+this.phone,code:null}},mounted:function(){var e=u(a.a.mark(function e(){return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}},e)}));function t(){return e.apply(this,arguments)}return t}(),methods:{updateIdentifyingCode:function(){var e=u(a.a.mark(function e(){var t;return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:t=window.location.origin,this.identifyingCode="".concat(t,"/api-teacher/code/getLoginImage?phone=").concat(this.phone,"&token=").concat(Math.random());case 2:case"end":return e.stop()}},e,this)}));function t(){return e.apply(this,arguments)}return t}(),checkVerifyLoginImage:function(){var e=u(a.a.mark(function e(){return a.a.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,!(this.code.length<4)){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,Object(r["u"])({phone:this.phone,code:this.code});case 5:return e.next=7,Object(r["n"])({mobile:this.phone});case 7:this.$toast("验证码已发送"),this.$emit("input",!1),this.$emit("onCodeSend",!0),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](0),this.updateIdentifyingCode();case 15:case"end":return e.stop()}},e,this,[[0,12]])}));function t(){return e.apply(this,arguments)}return t}(),onClose:function(){this.$emit("input",!1)}},watch:{code:function(e){e.length>=4&&this.checkVerifyLoginImage()}}},d=p,l=(n("39c7"),n("2877")),h=Object(l["a"])(d,o,i,!1,null,"4ee80e4b",null);t["a"]=h.exports},"657b":function(e,t,n){"use strict";var o=n("dd8c"),i=n.n(o);i.a},"9d64":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUQAAABaCAMAAAD3n9+rAAABNVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8BwbUUxrsNxbn4/v0eyb7v/Ptz3ddb2NCi6eRp29RB0snX9vQ4z8YlysC07uqX5uG/8O2r6+ff+PbN8/Hn+vnG8u/S9fKP5N+H4t1L1Mxg2dFW1s5R1c1H08oyzsR+4NopzMJi2dIuzGsgAAAARHRSTlMA5i4ftQT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rqtsSqwDz+LDNP/hUe/7Y7k05H3rw0JeK3WiL65GF9MikRPSlWrsekbP5jYfIAh8mjRB4Nk4faTB6v9FiYPOhr8si5R8Tk4Ydj8BtP5UjXgZbThAAAAABJRU5ErkJggg=="},bb23:function(e,t,n){"use strict";n.r(t);var o=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"login"},[e._m(0),n("div",{directives:[{name:"show",rawName:"v-show",value:e.isTrue,expression:"isTrue"}],staticClass:"container"},[n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.phoneNumber,expression:"phoneNumber"}],staticClass:"input",attrs:{type:"number",placeholder:"请输入手机号",maxlength:"11",minlength:"11",pattern:"[0-9]"},domProps:{value:e.phoneNumber},on:{keyup:function(t){return e.onKeyUp()},input:function(t){t.target.composing||(e.phoneNumber=t.target.value)}}})]),n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.password,expression:"password"}],staticClass:"input",attrs:{type:"password",placeholder:"请输入密码"},domProps:{value:e.password},on:{keyup:function(t){return e.onKeyUp()},input:function(t){t.target.composing||(e.password=t.target.value)}}})]),n("van-button",{attrs:{round:"",size:"large",disabled:e.pwdDisable},on:{click:e.onLogin}},[e._v("登录")]),n("span",{staticClass:"login-change",on:{click:function(t){e.isTrue=!1}}},[e._v("验证码登录")]),n("span",{staticClass:"login-change",staticStyle:{float:"left"},on:{click:e.onRegister}},[e._v("立即注册")])],1),n("div",{directives:[{name:"show",rawName:"v-show",value:!e.isTrue,expression:"!isTrue"}],staticClass:"container"},[n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.phoneNumber,expression:"phoneNumber"}],staticClass:"input",attrs:{type:"number",placeholder:"请输入手机号",maxlength:"11",minlength:"11",pattern:"[0-9]"},domProps:{value:e.phoneNumber},on:{keyup:function(t){return e.onKeyUp()},input:function(t){t.target.composing||(e.phoneNumber=t.target.value)}}})]),n("div",{staticClass:"input-group"},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.code,expression:"code"}],staticClass:"input",attrs:{type:"text",placeholder:"请输入验证码",minlength:"6",maxlength:"6"},domProps:{value:e.code},on:{keyup:function(t){return e.onKeyUp()},input:function(t){t.target.composing||(e.code=t.target.value)}}}),n("span",{directives:[{name:"show",rawName:"v-show",value:e.countDownStatus,expression:"countDownStatus"}],staticClass:"code-text",on:{click:e.onSendCode}},[e._v(e._s(e.codeText))]),n("span",{directives:[{name:"show",rawName:"v-show",value:!e.countDownStatus,expression:"!countDownStatus"}],staticClass:"code-text"},[n("van-count-down",{ref:"countdown",attrs:{"auto-start":!1,time:e.countDownTime,format:"ss秒"},on:{finish:e.onFinished}})],1)]),n("van-button",{attrs:{round:"",size:"large",disabled:e.codeDisable},on:{click:e.onCodeLogin}},[e._v("登录")]),n("span",{staticClass:"login-change",on:{click:function(t){e.isTrue=!0}}},[e._v("密码登录")]),n("span",{staticClass:"login-change",staticStyle:{float:"left"},on:{click:e.onRegister}},[e._v("立即注册")]),e.showImgCode?n("m-img-code",{attrs:{phone:e.phoneNumber},on:{onCodeSend:e.onCodeSend},model:{value:e.showImgCode,callback:function(t){e.showImgCode=t},expression:"showImgCode"}}):e._e()],1)])},i=[function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"logo"},[o("img",{attrs:{src:n("9d64"),alt:""}})])}],s=n("b562"),a=n("6354"),r={name:"login",components:{MImgCode:a["a"]},data:function(){return{groupId:this.$route.query.groupId,pwdDisable:!0,codeDisable:!0,isTrue:!0,countDownStatus:!0,phoneNumber:null,password:null,code:null,codeText:"获取验证码",countDownTime:12e4,isClick:!1,showImgCode:!1}},mounted:function(){localStorage.removeItem("userInfo"),localStorage.removeItem("Authorization")},methods:{onKeyUp:function(){this.isTrue?this.phoneNumber&&this.password?this.pwdDisable=!1:this.pwdDisable=!0:this.phoneNumber&&this.code?this.codeDisable=!1:this.codeDisable=!0},onRegister:function(){this.$router.push({path:"/appRegister",query:{groupId:this.groupId}})},onSendCode:function(){var e=this;this.checkPhone(this.phoneNumber)&&Object(s["l"])({mobile:this.phoneNumber}).then(function(t){var n=t.data;200==n.code?1==n.data?e.showImgCode=!0:e.$dialog.confirm({message:"此手机号尚未注册<br/>是否注册?",confirmButtonText:"注册"}).then(function(){e.$router.push({path:"/appRegister",query:{groupId:e.groupId}})}).catch(function(){}):e.$toast(n.msg)})},onCodeSend:function(){this.countDownStatus=!1,this.$refs.countdown.start()},onCodeLogin:function(){var e=this;if(!this.isClick){this.isClick=!0;var t={clientId:"student",clientSecret:"student",phone:this.phoneNumber,smsCode:this.code,channel:"H5"};Object(s["o"])(t).then(function(t){var n=t.data;if(e.isClick=!1,200==n.code){var o=n.data.authentication;localStorage.setItem("userInfo",o.token_type+" "+o.access_token),n.data.password?e.$router.push({path:"/classDetail",query:{groupId:e.groupId}}):e.$router.push({path:"/appSetInfo",query:{groupId:e.groupId}})}else 99==n.code?e.$dialog.confirm({message:"此手机号尚未注册<br/>是否注册?",confirmButtonText:"注册"}).then(function(){e.$router.push({path:"/appRegister",query:{groupId:e.groupId}})}).catch(function(){}):e.$toast(n.msg)})}},onLogin:function(){var e=this;this.isClick||(this.isClick=!0,Object(s["t"])({clientId:"student",clientSecret:"student",username:this.phoneNumber,password:this.password}).then(function(t){var n=t.data;if(e.isClick=!1,200==n.code){var o=n.data.authentication;localStorage.setItem("userInfo",o.token_type+" "+o.access_token),e.$router.push({path:"/classDetail",query:{groupId:e.groupId}})}else 99==n.code?e.$dialog.confirm({message:"此手机号尚未注册<br/>是否注册?",confirmButtonText:"注册"}).then(function(){e.$router.push({path:"/appRegister",query:{groupId:e.groupId}})}).catch(function(){}):e.$toast(n.msg)}))},onFinished:function(){this.countDownStatus=!0,this.$refs.countdown.reset()},checkPhone:function(e){var t=!0;return/^1(3|4|5|6|7|8|9)\d{9}$/.test(e)||(this.$toast("手机号输入有误"),t=!1),t}}},c=r,u=(n("657b"),n("2877")),p=Object(u["a"])(c,o,i,!1,null,"42f55cc5",null);t["default"]=p.exports},cacf:function(e,t,n){},dd8c:function(e,t,n){}}]);