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