import{_ as a,s as e,aI as s,e as o,f as r,h as d,w as t,i as l,o as n,j as m,k as i,p as u}from"./index-BiZOcPG_.js";import{_ as f,a as w,b as p}from"./uni-forms.Cb3LtJ7S.js";import"./uni-icons.BKTssli-.js";const P=a({data:()=>({formData:{oldPassword:"",newPassword:"",confirmPassword:""},rules:{oldPassword:{rules:[{required:!0,errorMessage:"请输入原密码"}]},newPassword:{rules:[{required:!0,errorMessage:"请输入新密码"},{validateFunction:function(a,e,s,o){return s.confirmPassword!=s.newPassword&&o("两次输入的密码不一致"),s.newPassword==s.oldPassword&&o("新密码不能和原密码一致"),!0}}]},confirmPassword:{rules:[{required:!0,errorMessage:"请输入确认密码"},{validateFunction:function(a,e,s,o){return s.confirmPassword!=s.newPassword&&o("两次输入的密码不一致"),!0}}]}}}),methods:{onSubmit(){this.$refs.form.validate().then((a=>{this.$http({url:"/modifyPwd",method:"PUT",data:this.formData}).then((a=>{e({title:"修改密码成功",icon:"none"}),setTimeout((()=>{s()}),1e3)}))})).catch((a=>{console.log("表单错误信息：",a)}))}},onReady(){this.$refs.form.setRules(this.rules)}},[["render",function(a,e,s,P,c,h){const V=o(r("uni-easyinput"),f),_=o(r("uni-forms-item"),w),y=u,D=o(r("uni-forms"),p),b=l;return n(),d(b,{class:"page mine-password"},{default:t((()=>[m(D,{ref:"form",modelValue:c.formData,"label-position":"top","label-width":"100%"},{default:t((()=>[m(_,{label:"原密码:",name:"oldPassword"},{default:t((()=>[m(V,{type:"password",modelValue:c.formData.oldPassword,"onUpdate:modelValue":e[0]||(e[0]=a=>c.formData.oldPassword=a)},null,8,["modelValue"])])),_:1}),m(_,{label:"新密码:",name:"newPassword"},{default:t((()=>[m(V,{type:"password",modelValue:c.formData.newPassword,"onUpdate:modelValue":e[1]||(e[1]=a=>c.formData.newPassword=a)},null,8,["modelValue"])])),_:1}),m(_,{label:"确认密码:",name:"confirmPassword"},{default:t((()=>[m(V,{type:"password",modelValue:c.formData.confirmPassword,"onUpdate:modelValue":e[2]||(e[2]=a=>c.formData.confirmPassword=a)},null,8,["modelValue"])])),_:1}),m(y,{type:"primary",onClick:e[3]||(e[3]=a=>h.onSubmit())},{default:t((()=>[i("提交")])),_:1})])),_:1},8,["modelValue"])])),_:1})}],["__scopeId","data-v-61a91852"]]);export{P as default};
