"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[4058],{60456:function(e,l,s){s.r(l),s.d(l,{default:function(){return W}});var t=s(66252),o=s(3577);const a=(0,t._)("div",{class:"el-form-item-msg"},"请输入注册时填写的登录账号",-1),r={class:"yzm"},i=(0,t.Uk)("获取验证码"),m={key:0},d={class:"passwordView"},n={class:"title"},p=(0,t._)("div",{class:"name"},"安全程度等级:",-1),u={class:"strength"},c=(0,t._)("div",{class:"text"},[(0,t._)("div",{class:"icon"}),(0,t.Uk)("6-20位字符")],-1),w=(0,t._)("div",{class:"text"},[(0,t._)("div",{class:"icon"}),(0,t.Uk)("只能包含大小写字母、数字和标点符号（除空格）")],-1),f=(0,t.Uk)("提交"),h=(0,t.Uk)("返回登录");function v(e,l,s,v,g,_){const k=(0,t.up)("el-step"),y=(0,t.up)("el-steps"),b=(0,t.up)("el-input"),V=(0,t.up)("el-form-item"),W=(0,t.up)("el-button"),U=(0,t.up)("sc-password-strength"),z=(0,t.up)("el-popover"),C=(0,t.up)("el-form"),q=(0,t.up)("el-result"),A=(0,t.up)("common-page");return(0,t.wg)(),(0,t.j4)(A,{title:"重置密码"},{default:(0,t.w5)((()=>[(0,t.Wm)(y,{active:g.stepActive,simple:"","finish-status":"success"},{default:(0,t.w5)((()=>[(0,t.Wm)(k,{title:"填写新密码"}),(0,t.Wm)(k,{title:"完成重置"})])),_:1},8,["active"]),0===g.stepActive?((0,t.wg)(),(0,t.j4)(C,{key:0,ref:"form",model:g.form,rules:g.rules,"label-width":120},{default:(0,t.w5)((()=>[(0,t.Wm)(V,{label:"登录账号",prop:"user"},{default:(0,t.w5)((()=>[(0,t.Wm)(b,{modelValue:g.form.user,"onUpdate:modelValue":l[0]||(l[0]=e=>g.form.user=e),placeholder:"请输入登录账号"},null,8,["modelValue"]),a])),_:1}),(0,t.Wm)(V,{label:"手机号码",prop:"phone"},{default:(0,t.w5)((()=>[(0,t.Wm)(b,{modelValue:g.form.phone,"onUpdate:modelValue":l[1]||(l[1]=e=>g.form.phone=e),placeholder:"请输入手机号码"},null,8,["modelValue"])])),_:1}),(0,t.Wm)(V,{label:"短信验证码",prop:"yzm"},{default:(0,t.w5)((()=>[(0,t._)("div",r,[(0,t.Wm)(b,{modelValue:g.form.yzm,"onUpdate:modelValue":l[2]||(l[2]=e=>g.form.yzm=e),placeholder:"请输入6位短信验证码"},null,8,["modelValue"]),(0,t.Wm)(W,{onClick:_.getYzm,disabled:g.disabled},{default:(0,t.w5)((()=>[i,g.disabled?((0,t.wg)(),(0,t.iD)("span",m," ("+(0,o.toDisplayString)(g.time)+")",1)):(0,t.kq)("",!0)])),_:1},8,["onClick","disabled"])])])),_:1}),(0,t.Wm)(V,{label:"新密码",prop:"newpw"},{default:(0,t.w5)((()=>[(0,t.Wm)(z,{class:"popoverPassword",placement:"right",title:"",width:360,trigger:"click",content:""},{reference:(0,t.w5)((()=>[(0,t.Wm)(b,{modelValue:g.form.newpw,"onUpdate:modelValue":l[3]||(l[3]=e=>g.form.newpw=e),type:"password","show-password":"",placeholder:"请输入新密码"},null,8,["modelValue"])])),default:(0,t.w5)((()=>[(0,t._)("div",d,[(0,t._)("div",n,[p,(0,t._)("div",u,[(0,t.Wm)(U,{modelValue:g.form.newpw,"onUpdate:modelValue":l[4]||(l[4]=e=>g.form.newpw=e)},null,8,["modelValue"])])]),c,w])])),_:1})])),_:1}),(0,t.Wm)(V,{label:"确认新密码",prop:"newpw2"},{default:(0,t.w5)((()=>[(0,t.Wm)(b,{modelValue:g.form.newpw2,"onUpdate:modelValue":l[5]||(l[5]=e=>g.form.newpw2=e),type:"password","show-password":"",placeholder:"请再一次输入新密码"},null,8,["modelValue"])])),_:1}),(0,t.Wm)(V,null,{default:(0,t.w5)((()=>[(0,t.Wm)(W,{type:"primary",onClick:_.save},{default:(0,t.w5)((()=>[f])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model","rules"])):(0,t.kq)("",!0),1===g.stepActive?((0,t.wg)(),(0,t.j4)(q,{key:1,icon:"success",title:"密码重置成功","sub-title":"请牢记自己的新密码,返回登录使用新密码登录"},{extra:(0,t.w5)((()=>[(0,t.Wm)(W,{type:"primary",onClick:_.backLogin},{default:(0,t.w5)((()=>[h])),_:1},8,["onClick"])])),_:1})):(0,t.kq)("",!0)])),_:1})}s(57658);var g=s(67961),_=s(7764);const{verifyPhone:k}=s(62921);var y={components:{commonPage:g["default"],scPasswordStrength:_.Z},data(){return{stepActive:0,form:{user:"",phone:"",yzm:"",newpw:"",newpw2:""},rules:{user:[{required:!0,message:"请输入登录账号"}],phone:[{required:!0,message:"请输入手机号"},{validator:k,trigger:"blur"}],yzm:[{required:!0,message:"请输入短信验证码"}],newpw:[{required:!0,message:"请输入新的密码"}],newpw2:[{required:!0,message:"请再次输入新的密码"},{validator:(e,l,s)=>{l!==this.form.newpw?s(new Error("两次输入密码不一致")):s()}}]},disabled:!1,time:0}},mounted(){},methods:{async getYzm(){const e=await this.$refs.form.validateField("phone").catch((()=>{}));if(!e)return!1;const l=await this.$API.system.user.verifyCode.post({mobile:this.form.phone});if(200===l.code){this.$message.success("已发送短信至手机号码"),this.disabled=!0,this.time=60;const e=setInterval((()=>{this.time-=1,this.time<1&&(clearInterval(e),this.disabled=!1,this.time=0)}),1e3)}},async save(){const e=await this.$refs.form.validate().catch((()=>{}));if(!e)return!1;const l={mobile:this.form.phone,new_pwd:this.form.newpw,conf_pwd:this.form.newpw2,mobile_code:this.form.yzm},s=await this.$API.system.user.recoveryPwd.post(l);200===s.code&&(this.stepActive=1)},backLogin(){this.$router.push({path:"/login"})}}},b=s(83744);const V=(0,b.Z)(y,[["render",v]]);var W=V}}]);