diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.cshtml b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.cshtml index bb85cc641c..e012bdd3f4 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.cshtml +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.cshtml @@ -5,14 +5,31 @@ @inject ICurrentUser CurrentUser @model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Password.AccountProfilePasswordManagementGroupViewComponent.ChangePasswordInfoModel -

@L["ChangePassword"]


+

@L["ChangePassword"]


- @if (!Model.HideOldPasswordInput) - { - - } - - - +
+ @if (!Model.HideOldPasswordInput) + { + +
+ + +
+
+ } + +
+ + +
+
+ + +
+ + +
+ +
\ No newline at end of file diff --git a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.js b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.js index 473cfc1d81..ec23761729 100644 --- a/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.js +++ b/modules/account/src/Volo.Abp.Account.Web/Pages/Account/Components/ProfileManagementGroup/Password/Default.js @@ -1,25 +1,29 @@ (function ($) { - $("#PasswordVisibilityButton").click(function (e) { + $(".password-visibility-button").click(function (e) { let button = $(this); let passwordInput = button.parent().find("input"); if (!passwordInput) { return; } + if (passwordInput.attr("type") === "password") { passwordInput.attr("type", "text"); } else { passwordInput.attr("type", "password"); } + let icon = button.find("i"); if (icon) { icon.toggleClass("fa-eye-slash").toggleClass("fa-eye"); } }); + $(function () { var l = abp.localization.getResource("AbpAccount"); $('#ChangePasswordForm').submit(function (e) { e.preventDefault(); + if (!$('#ChangePasswordForm').valid()) { return false; } @@ -37,12 +41,12 @@ if (input.currentPassword && input.currentPassword == '') { return; } - + if (input.currentPassword == input.newPassword) { abp.message.error(l('NewPasswordSameAsOld')); return; } - + volo.abp.account.profile.changePassword(input).then(function (result) { abp.message.success(l('PasswordChanged')); abp.event.trigger('passwordChanged');