import{i as c}from"./user-BNyBegHT.js";import{I as _,v as b,r as V,d as n,o as x,e as y,f as l,k as r,l as s,n as w}from"./index-BCGxeHXw.js";const U={__name:"resetPwd",setup(q){const{proxy:u}=_(),o=b({oldPassword:void 0,newPassword:void 0,confirmPassword:void 0}),i=V({oldPassword:[{required:!0,message:"旧密码不能为空",trigger:"blur"}],newPassword:[{required:!0,message:"新密码不能为空",trigger:"blur"},{min:6,max:20,message:"长度在 6 到 20 个字符",trigger:"blur"},{pattern:/^[^<>"'|\\]+$/,message:`不能包含非法字符：< > " ' \\ |`,trigger:"blur"}],confirmPassword:[{required:!0,message:"确认密码不能为空",trigger:"blur"},{required:!0,validator:(m,e,a)=>{o.newPassword!==e?a(new Error("两次输入的密码不一致")):a()},trigger:"blur"}]});function f(){u.$refs.pwdRef.validate(m=>{m&&c(o.oldPassword,o.newPassword).then(()=>{u.$modal.msgSuccess("修改成功")})})}function P(){u.$tab.closePage()}return(m,e)=>{const a=n("el-input"),t=n("el-form-item"),p=n("el-button"),g=n("el-form");return x(),y(g,{ref:"pwdRef",model:s(o),rules:s(i),"label-width":"80px"},{default:l(()=>[r(t,{label:"旧密码",prop:"oldPassword"},{default:l(()=>[r(a,{modelValue:s(o).oldPassword,"onUpdate:modelValue":e[0]||(e[0]=d=>s(o).oldPassword=d),placeholder:"请输入旧密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),r(t,{label:"新密码",prop:"newPassword"},{default:l(()=>[r(a,{modelValue:s(o).newPassword,"onUpdate:modelValue":e[1]||(e[1]=d=>s(o).newPassword=d),placeholder:"请输入新密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),r(t,{label:"确认密码",prop:"confirmPassword"},{default:l(()=>[r(a,{modelValue:s(o).confirmPassword,"onUpdate:modelValue":e[2]||(e[2]=d=>s(o).confirmPassword=d),placeholder:"请确认新密码",type:"password","show-password":""},null,8,["modelValue"])]),_:1}),r(t,null,{default:l(()=>[r(p,{type:"primary",onClick:f},{default:l(()=>[...e[3]||(e[3]=[w("保存",-1)])]),_:1}),r(p,{type:"danger",onClick:P},{default:l(()=>[...e[4]||(e[4]=[w("关闭",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])}}};export{U as default};
