var $url="/password",data=utils.init({user:null,form:{password:null,confirmPassword:null}}),methods={apiGet:function(){var t=this;$api.get($url).then(function(i){var n=i.data;t.user=n.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,{password:this.form.password}).then(function(t){t.data;utils.success("密码更改成功！")}).catch(function(t){utils.error(t)}).then(function(){utils.loading(t,!1)})},validatePass:function(t,i,n){""===i?n(new Error("请再次输入密码")):i!==this.form.password?n(new Error("两次输入密码不一致!")):n()},btnSubmitClick:function(){var t=this;this.$refs.form.validate(function(i){i&&t.apiSubmit()})}},$vue=new Vue({el:"#main",data:data,methods:methods,created:function(){this.apiGet()}});