var $url="/lostPassword",$urlSendSms="/lostPassword/actions/sendSms",data=utils.init({form:{mobile:"",code:"",password:"",confirmPassword:""},countdown:0}),methods={apiSendSms:function(){var t=this;utils.loading(this,!0),$api.post($urlSendSms,{mobile:this.form.mobile}).then(function(i){i.data;utils.success("验证码发送成功，10分钟内有效"),t.countdown=60;var o=setInterval(function(){t.countdown-=1,t.countdown<=0&&clearInterval(o)},1e3)}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiSubmit:function(){var t=this;utils.loading(this,!0),$api.post($url,{mobile:this.form.mobile,code:this.form.code,password:this.form.password}).then(function(t){t.data;utils.alertSuccess({title:"恭喜，密码重置成功",button:"进入登录页",callback:function(){location.href=utils.getRootUrl("login")}})}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},isMobile:function(t){return/^1[3|4|5|7|8][0-9]\d{8}$/.test(t)},btnSendSmsClick:function(){this.countdown>0||(this.form.mobile?this.isMobile(this.form.mobile)?this.apiSendSms():utils.error("请输入有效的手机号码"):utils.error("手机号码不能为空"))},btnLoginClick:function(){location.href=utils.getRootUrl("login")},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(i){i&&t.apiSubmit()})},validatePass:function(t,i,o){""===i?o(new Error("请再次输入密码")):i!==this.form.password?o(new Error("两次输入密码不一致!")):o()}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){utils.loading(this,!1)}});