"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[6965],{78609:function(e,l,o){o.r(l),o.d(l,{default:function(){return h}});var s=o(66252);const d=(0,s._)("div",{class:"el-form-item-msg"},"必须提供当前登录用户密码才能进行更改",-1),r={class:"passwordView"},a={class:"title"},t=(0,s._)("div",{class:"name"},"安全程度等级:",-1),p={class:"strength"},n=(0,s._)("div",{class:"text"},[(0,s._)("div",{class:"icon"}),(0,s.Uk)("6-20位字符")],-1),w=(0,s._)("div",{class:"text"},[(0,s._)("div",{class:"icon"}),(0,s.Uk)("只能包含大小写字母、数字和标点符号（除空格）")],-1),u=(0,s.Uk)("保存密码");function m(e,l,o,m,c,i){const f=(0,s.up)("el-alert"),_=(0,s.up)("el-input"),h=(0,s.up)("el-form-item"),v=(0,s.up)("sc-password-strength"),g=(0,s.up)("el-popover"),V=(0,s.up)("el-button"),W=(0,s.up)("el-form"),y=(0,s.up)("el-card");return(0,s.wg)(),(0,s.j4)(y,{shadow:"never",header:"修改密码"},{default:(0,s.w5)((()=>[(0,s.Wm)(f,{title:"密码更新成功后，您将被重定向到登录页面，您可以使用新密码重新登录。",type:"warning",closable:!1,"show-icon":"",style:{"margin-bottom":"15px"}}),(0,s.Wm)(W,{ref:"form",model:c.form,rules:c.rules,"label-width":"120px",style:{width:"480px","margin-top":"20px"}},{default:(0,s.w5)((()=>[(0,s.Wm)(h,{label:"当前密码",prop:"old_pwd"},{default:(0,s.w5)((()=>[(0,s.Wm)(_,{modelValue:c.form.old_pwd,"onUpdate:modelValue":l[0]||(l[0]=e=>c.form.old_pwd=e),type:"password","show-password":"",placeholder:"请输入当前密码"},null,8,["modelValue"]),d])),_:1}),(0,s.Wm)(h,{label:"新密码",prop:"new_pwd"},{default:(0,s.w5)((()=>[(0,s.Wm)(g,{class:"popoverPassword",placement:"right",title:"",width:360,trigger:"click",content:""},{reference:(0,s.w5)((()=>[(0,s.Wm)(_,{modelValue:c.form.new_pwd,"onUpdate:modelValue":l[1]||(l[1]=e=>c.form.new_pwd=e),type:"password","show-password":"",placeholder:"请输入新密码"},null,8,["modelValue"])])),default:(0,s.w5)((()=>[(0,s._)("div",r,[(0,s._)("div",a,[t,(0,s._)("div",p,[(0,s.Wm)(v,{modelValue:c.form.new_pwd,"onUpdate:modelValue":l[2]||(l[2]=e=>c.form.new_pwd=e)},null,8,["modelValue"])])]),n,w])])),_:1})])),_:1}),(0,s.Wm)(h,{label:"确认新密码",prop:"conf_pwd"},{default:(0,s.w5)((()=>[(0,s.Wm)(_,{modelValue:c.form.conf_pwd,"onUpdate:modelValue":l[3]||(l[3]=e=>c.form.conf_pwd=e),type:"password","show-password":"",placeholder:"请再次输入新密码"},null,8,["modelValue"])])),_:1}),(0,s.Wm)(h,null,{default:(0,s.w5)((()=>[(0,s.Wm)(V,{type:"primary",onClick:i.save},{default:(0,s.w5)((()=>[u])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model","rules"])])),_:1})}var c=o(7764),i={components:{scPasswordStrength:c.Z},data(){return{form:{old_pwd:"",new_pwd:"",conf_pwd:""},rules:{old_pwd:[{required:!0,message:"请输入当前密码"}],new_pwd:[{required:!0,message:"请输入新密码"}],conf_pwd:[{required:!0,message:"请再次输入新密码"},{validator:(e,l,o)=>{l!==this.form.new_pwd?o(new Error("两次输入密码不一致")):o()}}]}}},methods:{save(){this.$refs.form.validate((async e=>{if(!e)return!1;{const e=await this.$API.system.user.changePwd.post(this.form);200===e.code&&this.$alert("密码修改成功，是否跳转至登录页使用新密码登录","修改成功",{type:"success",center:!0}).then((()=>{this.$router.replace({path:"/login"})})).catch((()=>{}))}}))}}},f=o(83744);const _=(0,f.Z)(i,[["render",m]]);var h=_}}]);