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 febab6d081..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,13 +5,31 @@
@inject ICurrentUser CurrentUser
@model Volo.Abp.Account.Web.Pages.Account.Components.ProfileManagementGroup.Password.AccountProfilePasswordManagementGroupViewComponent.ChangePasswordInfoModel
-
@L["ChangePassword"]
+@L["ChangePassword"]
+
+ @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 e2f2fd4969..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,7 +1,26 @@
(function ($) {
+ $(".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();
@@ -19,15 +38,15 @@
return;
}
- if (input.currentPassword && input.currentPassword == ''){
+ if (input.currentPassword && input.currentPassword == '') {
return;
}
-
- if(input.currentPassword == input.newPassword) {
+
+ 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');