import{A as c,B as V,r as w,e as u,o as h,c as k,f as r,h as t,m as f,v as C,_ as F}from"./index-C1_1_QXk.js";function y(n){return c({url:"/djl-account/password/check/password",method:"get",params:n})}function q(n){return c({url:"/djl-account/password/update/password",method:"get",params:n})}const B={class:"container"},E=V({__name:"index",setup(n){const{proxy:p}=C(),o=w({oldpwd:"",newpwd:"",okpwd:""}),_=w({oldpwd:[{required:!0,message:"请输入原密码",trigger:"blur"},{validator:g,trigger:"blur"}],newpwd:[{required:!0,message:"请输入新密码",trigger:"blur"}],okpwd:[{required:!0,message:"请再次输入新密码",trigger:"blur"},{validator:v,trigger:"blur"}]});function g(s,e,l){y({oldpwd:e}).then(d=>{d?l():l(new Error("密码错误,请重新输入"))})}function v(s,e,l){e!=o.value.newpwd?l(new Error("两次密码请输入一致")):l()}function m(){p.$refs.ruleFormRef.resetFields()}const b=()=>{p.$refs.ruleFormRef.validate(s=>{s&&q({oldpwd:o.value.oldpwd,password:o.value.newpwd}).then(e=>{p.$modal.msgSuccess("密码修改成功，下次请使用新密码登录。"),m()})})};return(s,e)=>{const l=u("el-input"),d=u("el-form-item"),i=u("el-button"),x=u("el-form");return h(),k("div",B,[r(x,{"label-position":"right","label-width":"auto",model:o.value,style:{"max-width":"600px"},ref:"ruleFormRef",rules:_.value},{default:t(()=>[r(d,{label:"原密码",prop:"oldpwd"},{default:t(()=>[r(l,{modelValue:o.value.oldpwd,"onUpdate:modelValue":e[0]||(e[0]=a=>o.value.oldpwd=a),maxlength:"25"},null,8,["modelValue"])]),_:1}),r(d,{label:"新密码",prop:"newpwd"},{default:t(()=>[r(l,{modelValue:o.value.newpwd,"onUpdate:modelValue":e[1]||(e[1]=a=>o.value.newpwd=a),maxlength:"25"},null,8,["modelValue"])]),_:1}),r(d,{label:"确认新密码",prop:"okpwd"},{default:t(()=>[r(l,{modelValue:o.value.okpwd,"onUpdate:modelValue":e[2]||(e[2]=a=>o.value.okpwd=a),maxlength:"25"},null,8,["modelValue"])]),_:1}),r(i,{type:"primary",onClick:b},{default:t(()=>[f("提交")]),_:1}),r(i,{onClick:m},{default:t(()=>[f("重置")]),_:1})]),_:1},8,["model","rules"])])}}}),R=F(E,[["__scopeId","data-v-bd31627f"]]);export{R as default};
