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