var $url="/settings/usersLayerPassword",data=utils.init({userId:utils.getQueryInt("userId"),user:null,form:{password:null,confirmPassword:null}}),methods={apiGet:function(){var t=this;$api.get($url,{params:{userId:this.userId}}).then(function(s){var i=s.data;t.user=i.user}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},apiSubmit:function(){var t=this;utils.loading(this,!0),$api.post($url,{userId:this.userId,password:this.form.password}).then(function(t){t.data;utils.success("密码更改成功！"),utils.closeLayer()}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},validatePass:function(t,s,i){""===s?i(new Error("请再次输入密码")):s!==this.form.password?i(new Error("两次输入密码不一致!")):i()},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(s){s&&t.apiSubmit()})},btnCancelClick:function(){utils.closeLayer()}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});