app.controller('systemConfigCtrl', ['$scope', '$http', '$timeout', 'toaster', 'md5', function ($scope, $http, $timeout, toaster, MD5) { //修改密码提交 $scope.savePassword = function () { //表单未校验通过不能提交 if ($scope.passwordForm.$invalid) { return; } var url = "/manager/changePassword"; var password = MD5.createHash($scope.passwordData.password + ''); $http({ method: 'POST', url: url, data: { id: $scope.passwordData.id, password: password, } }).then(function (response) { toaster.pop("success", "提示", "修改密码成功!"); }, function (response) { toaster.pop("error", "提示", "修改密码失败!"); }); }; }]);