accountCtrl.js 857 B

12345678910111213141516171819202122232425262728
  1. app.controller('systemConfigCtrl', ['$scope', '$http', '$timeout', 'toaster', 'md5', function ($scope, $http, $timeout, toaster, MD5) {
  2. //修改密码提交
  3. $scope.savePassword = function () {
  4. //表单未校验通过不能提交
  5. if ($scope.passwordForm.$invalid) {
  6. return;
  7. }
  8. var url = "/manager/changePassword";
  9. var password = MD5.createHash($scope.passwordData.password + '');
  10. $http({
  11. method: 'POST',
  12. url: url,
  13. data: {
  14. id: $scope.passwordData.id,
  15. password: password,
  16. }
  17. }).then(function (response) {
  18. toaster.pop("success", "提示", "修改密码成功!");
  19. }, function (response) {
  20. toaster.pop("error", "提示", "修改密码失败!");
  21. });
  22. };
  23. }]);