webpackJsonp([30],{qjax:function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=s("FevL"),a=s("AAHV"),o=s("2vqF");s("P5P/");i.default.component(a.Button.name,a.Button),i.default.component(o.Popup.name,o.Popup);var r={data:()=>({user:{},showDialog:!1,imgCode:"",captchaImg:"",tips:"获取验证码",btnDisable:!1,first:!0}),created(){this.changeCaptcha()},methods:{getVerify(){if(this.user.phone)if(this.imgCode){var t={phone:this.user.phone,verify:this.imgCode,type:"SMS_1"};this.$axios.post(this.api.verifyCode,t,{withCredentials:!0}).then(t=>{if(1==t.data.code){this.$dialog.toast({mes:"验证码已发送",timeout:1e3}),this.showDialog=!1;var e=60,s=this;this.btnDisable=!0;var i=setInterval(function(){s.tips=e+"秒后重新获取",--e<=0&&(clearInterval(i),s.tips="重新获取验证码",s.btnDisable=!1)},1e3)}else this.$dialog.toast({mes:"出了点小问题，请重试",timeout:1e3})})}else this.$dialog.toast({mes:"请输入验证码",timeout:1e3});else this.$dialog.toast({mes:"请输入手机号",timeout:1e3})},changeCaptcha(){this.captchaImg=this.api.captcha+"?v="+Math.random()},next(){if(this.user.phone)if(this.user.code){var t=this.user;t.step="1",this.$axios.post(this.api.forgetPwd,t).then(t=>{1==t.data.code?this.first=!1:this.$dialog.toast({mes:t.data.msg,timeout:1e3})})}else this.$dialog.toast({mes:"请输入验证码",timeout:1e3});else this.$dialog.toast({mes:"请输入手机号",timeout:1e3})},submit(){if(this.user.pwd)if(this.user.repwd)if(this.user.pwd==this.user.repwd){var t={pwd:this.user.pwd,repwd:this.user.repwd,step:"2"};this.$axios.post(this.api.forgetPwd,t).then(t=>{1==t.data.code?(this.$dialog.toast({mes:"新密码设置成功",timeout:1e3}),this.$router.push("/user/login")):this.$dialog.toast({mes:res.data.msg,timeout:1e3})})}else this.$dialog.toast({mes:"新密码设置不一致",timeout:1e3});else this.$dialog.toast({mes:"请再次输入新密码",timeout:1e3});else this.$dialog.toast({mes:"请输入新密码",timeout:1e3})}}},n={render:function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("v-title",{attrs:{title:"找回密码"}}),t._v(" "),s("div",{staticClass:"login-form"},[t.first?s("div",{staticClass:"first"},[s("span",[t._v("验证信息")]),t._v(" "),s("div",{staticClass:"group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.phone,expression:"user.phone"}],staticClass:"form-text",attrs:{type:"text",placeholder:"请输入手机号"},domProps:{value:t.user.phone},on:{input:function(e){e.target.composing||t.$set(t.user,"phone",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.code,expression:"user.code"}],staticClass:"form-text",attrs:{type:"password",placeholder:"请输入验证码"},domProps:{value:t.user.code},on:{input:function(e){e.target.composing||t.$set(t.user,"code",e.target.value)}}}),t._v(" "),s("button",{attrs:{type:"button",disabled:t.btnDisable},on:{click:function(e){t.showDialog=!0}}},[t._v(t._s(t.tips))])]),t._v(" "),s("div",{staticClass:"btn"},[s("yd-button",{attrs:{type:"danger",size:"large"},nativeOn:{click:function(e){t.next()}}},[t._v("下一步")])],1)]):t._e(),t._v(" "),t.first?t._e():s("div",{staticClass:"second"},[s("span",[t._v("重置密码")]),t._v(" "),s("div",{staticClass:"group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.pwd,expression:"user.pwd"}],staticClass:"form-text",attrs:{type:"text",placeholder:"请输入新密码"},domProps:{value:t.user.pwd},on:{input:function(e){e.target.composing||t.$set(t.user,"pwd",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.user.repwd,expression:"user.repwd"}],staticClass:"form-text",attrs:{type:"text",placeholder:"请再次输入新密码"},domProps:{value:t.user.repwd},on:{input:function(e){e.target.composing||t.$set(t.user,"repwd",e.target.value)}}})]),t._v(" "),s("div",{staticClass:"btn"},[s("yd-button",{attrs:{type:"danger",size:"large"},nativeOn:{click:function(e){t.submit()}}},[t._v("确定")])],1)])]),t._v(" "),s("yd-popup",{attrs:{position:"center",width:"90%"},model:{value:t.showDialog,callback:function(e){t.showDialog=e},expression:"showDialog"}},[s("div",{staticClass:"imgCodePop"},[s("p",[s("input",{directives:[{name:"model",rawName:"v-model",value:t.imgCode,expression:"imgCode"}],attrs:{type:"text",placeholder:"请输入图片验证码"},domProps:{value:t.imgCode},on:{input:function(e){e.target.composing||(t.imgCode=e.target.value)}}}),t._v(" "),s("img",{attrs:{src:t.captchaImg},on:{click:t.changeCaptcha}})]),t._v(" "),s("p",[s("yd-button",{attrs:{type:"danger"},nativeOn:{click:function(e){t.getVerify()}}},[t._v("确定")])],1)])])],1)},staticRenderFns:[]};var d=s("D8HT")(r,n,!1,function(t){s("t50K")},"data-v-0c681acc",null);e.default=d.exports},t50K:function(t,e){}});