x-php-Admin/dist/static/js/179.d58a4096.js

1 line
3.6 KiB
JavaScript
Raw Normal View History

2023-10-20 07:02:57 +00:00
"use strict";(self["webpackChunkX_PHP_Admin"]=self["webpackChunkX_PHP_Admin"]||[]).push([[179],{5179:function(e,s,r){r.r(s),r.d(s,{default:function(){return c}});var l=r(6808);const o=(0,l._)("div",{class:"el-form-item-msg"},"必须提供当前登录用户密码才能进行更改",-1),t=(0,l._)("div",{class:"el-form-item-msg"},"请输入包含英文、数字的8位以上密码",-1);function a(e,s,r,a,d,n){const m=(0,l.up)("el-alert"),u=(0,l.up)("el-input"),w=(0,l.up)("el-form-item"),p=(0,l.up)("x-password-strength"),i=(0,l.up)("el-button"),f=(0,l.up)("el-form"),h=(0,l.up)("el-card");return(0,l.wg)(),(0,l.j4)(h,{shadow:"never",header:"修改密码",style:{margin:"10px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(m,{title:"密码更新成功后,您将被重定向到登录页面,您可以使用新密码重新登录。",type:"info","show-icon":"",style:{"margin-bottom":"15px"}}),(0,l.Wm)(f,{ref:"form",model:d.form,rules:d.rules,"label-width":"120px",style:{"margin-top":"20px"}},{default:(0,l.w5)((()=>[(0,l.Wm)(w,{label:"当前密码",prop:"userPassword"},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{modelValue:d.form.userPassword,"onUpdate:modelValue":s[0]||(s[0]=e=>d.form.userPassword=e),type:"password","show-password":"",placeholder:"请输入当前密码"},null,8,["modelValue"]),o])),_:1}),(0,l.Wm)(w,{label:"新密码",prop:"newPassword"},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{modelValue:d.form.newPassword,"onUpdate:modelValue":s[1]||(s[1]=e=>d.form.newPassword=e),type:"password","show-password":"",placeholder:"请输入新密码"},null,8,["modelValue"]),(0,l.Wm)(p,{modelValue:d.form.newPassword,"onUpdate:modelValue":s[2]||(s[2]=e=>d.form.newPassword=e)},null,8,["modelValue"]),t])),_:1}),(0,l.Wm)(w,{label:"确认新密码",prop:"confirmNewPassword"},{default:(0,l.w5)((()=>[(0,l.Wm)(u,{modelValue:d.form.confirmNewPassword,"onUpdate:modelValue":s[3]||(s[3]=e=>d.form.confirmNewPassword=e),type:"password","show-password":"",placeholder:"请再次输入新密码"},null,8,["modelValue"])])),_:1}),(0,l.Wm)(w,null,{default:(0,l.w5)((()=>[(0,l.Wm)(i,{type:"primary",onClick:n.save},{default:(0,l.w5)((()=>[(0,l.Uk)("保存密码")])),_:1},8,["onClick"])])),_:1})])),_:1},8,["model","rules"])])),_:1})}var d=r(9511);const n={class:"x-password-strength"};function m(e,s,r,o,t,a){return(0,l.wg)(),(0,l.iD)("div",n,[(0,l._)("div",{class:(0,d.C_)(["x-password-strength-bar",`x-password-strength-level-${t.level}`])},null,2)])}var u={props:{modelValue:{type:String,default:""}},data(){return{level:0}},watch:{modelValue(){this.strength(this.modelValue)}},mounted(){this.strength(this.modelValue)},methods:{strength(e){var s=0,r=e.length>=6,l=/\d/.test(e),o=/[a-z]/.test(e),t=/[A-Z]/.test(e),a=!/(\w)\1{2}/.test(e),d=/[`~!@#$%^&*()_+<>?:"{},./;'[\]]/.test(e);return e.length<=0?(s=0,this.level=s,!1):r?(l&&(s+=1),o&&(s+=1),t&&(s+=1),a&&(s+=1),d&&(s+=1),void(this.level=s)):(s=1,this.level=s,!1)}}},w=r(8700);const p=(0,w.Z)(u,[["render",m],["__scopeId","data-v-f6e10340"]]);var i=p,f={components:{xPasswordStrength:i},data(){return{form:{userPassword:"",newPassword:"",confirmNewPassword:""},rules:{userPassword:[{required:!0,message:"请输入当前密码"}],newPassword:[{required:!0,message:"请输入新密码"}],confirmNewPassword:[{required:!0,message:"请再次输入新密码"},{validator:(e,s,r)=>{s!==this.form.newPassword?r(new Error("两次输入密码不一致")):r()}}]}}},methods:{save(){this.$refs.form.validate((e=>{if(!e)return!1;this.$alert("密码修改成功,是否跳转至登录页使用新密码登录","修改成功",{type:"success",center:!0}).then((()=>{this.$router.replace({path:"/login"})})).catch((()=>{}))}))}}};const h=(0,w.Z)(f,[["render",a]]);var c=h}}]);