// Generated by CoffeeScript 1.8.0
(function() {
  var loadData;

  loadData = function() {
    if (!isNotNull($("#oldpwd")[0], "原密码")) {
      return;
    }
    if (!verifyPwd($("#newpwd")[0], $("#confir")[0])) {
      return;
    }
    Ajax({
      url: baseUrl + '/api/user/change_pwd.do',
      data: $("form").serialize(),
      success: function(obj) {
        if (obj.status === 200) {
        	 toast.success({msg:"修改密码成功，请重新登录"});
        	 setTimeout(function(){
        		 return location.href="./../user/login.html"
        	 },1000);
        }else{
        	wrongMsg(obj.message);
        }
      }
    });
    return false;
  };

  $(function() {
    $(".toast").hide();
    $("#text").html("修改密码");
    return $(".am-button").on("click", function() {
      return loadData();
    });
  });

}).call(this);
