diff --git a/src/pages/src/language/lang/en.js b/src/pages/src/language/lang/en.js index a6083918a..7cf22d291 100644 --- a/src/pages/src/language/lang/en.js +++ b/src/pages/src/language/lang/en.js @@ -164,7 +164,6 @@ export default { 修复: '【FIX】', 优化: '【OPTIMIZATION】', // 密码 - 原密码: 'Old Password', 重置密码: 'Reset Password', 密码长度为: 'Password length is', '-32个字符,必须包含': '-32 characters, it must be included', @@ -188,7 +187,6 @@ export default { '两次输入的密码不一致,请重新输入': 'The passwords entered twice do not match. Please re-enter them', 设置新密码: 'Set new password', 请输入新密码进行密码重设: 'Please enter a new password for password reset', - 请输入原密码: 'Please enter old password', 请输入新密码: 'Please enter a new password', 请再次确认新密码: 'Please confirm the new password again', 密码修改成功: 'Password changed successfully', diff --git a/src/pages/src/language/lang/zh.js b/src/pages/src/language/lang/zh.js index d72704676..1d59f3424 100644 --- a/src/pages/src/language/lang/zh.js +++ b/src/pages/src/language/lang/zh.js @@ -164,7 +164,6 @@ export default { 修复: '【修复】', 优化: '【优化】', // 密码 - 原密码: '原密码', 重置密码: '重置密码', 密码长度为: '密码长度为', '-32个字符,必须包含': '-32个字符,必须包含', @@ -188,7 +187,6 @@ export default { '两次输入的密码不一致,请重新输入': '两次输入的密码不一致,请重新输入', 设置新密码: '设置新密码', 请输入新密码进行密码重设: '请输入新密码进行密码重设', - 请输入原密码: '请输入原密码', 请输入新密码: '请输入新密码', 请再次确认新密码: '请再次确认新密码', 密码修改成功: '密码修改成功', diff --git a/src/pages/src/views/organization/details/UserMaterial.vue b/src/pages/src/views/organization/details/UserMaterial.vue index ef994d338..558da3f1f 100644 --- a/src/pages/src/views/organization/details/UserMaterial.vue +++ b/src/pages/src/views/organization/details/UserMaterial.vue @@ -51,35 +51,20 @@
-

{{$t('重置密码')}}

- +

{{$t('确认')}} @@ -189,16 +174,11 @@ export default { localAvatar: '', isForbid: false, phoneNumber: this.$t('点击查看'), - isCorrectOldPw: false, isCorrectPw: false, // 是否显示重置密码的弹窗 isShowReset: false, - oldPassword: '', newPassword: '', - passwordInputType: { - oldPassword: 'password', - newPassword: 'password', - }, + passwordInputType: 'password', passwordRules: null, }; }, @@ -208,11 +188,8 @@ export default { return fieldInfo.key !== 'department_name' && fieldInfo.key !== 'leader'; }); }, - oldPasswordIconClass() { - return this.passwordInputType.oldPassword === 'password' ? 'icon-hide' : 'icon-eye'; - }, passwordIconClass() { - return this.passwordInputType.newPassword === 'password' ? 'icon-hide' : 'icon-eye'; + return this.passwordInputType === 'password' ? 'icon-hide' : 'icon-eye'; }, passwordValidDays() { return this.$store.state.passwordValidDaysList.find(item => ( @@ -309,9 +286,6 @@ export default { return; } this.isShowReset = true; - // 清空上次输入 - this.oldPassword = ''; - this.newPassword = ''; }, // 验证密码的格式 async confirmReset() { @@ -347,18 +321,6 @@ export default { } if (this.passwordRules) { // 如果上面拿到了规则就进行前端校验 - // 原密码校验, 任何人在重置admin密码时,需要先输入原密码 - if (this.isAdmin) { - this.isCorrectOldPw = !this.$validatePassportByRules(this.oldPassword, this.passwordRules); - if (this.isCorrectOldPw) { - this.$bkMessage({ - message: this.$getMessageByRules(this, this.passwordRules), - theme: 'error', - }); - return; - } - } - // 新密码校验 this.isCorrectPw = !this.$validatePassportByRules(this.newPassword, this.passwordRules); if (this.isCorrectPw) { this.$bkMessage({ @@ -374,16 +336,11 @@ export default { this.clickSecond = true; try { this.$emit('showBarLoading'); - const passwordData = { - password: this.newPassword.trim(), - }; - // 任何人在重置admin密码时,需要先输入原密码 - if (this.isAdmin) { - passwordData.old_password = this.oldPassword.trim(); - }; await this.$store.dispatch('organization/patchProfile', { id: this.currentProfile.id, - data: passwordData, + data: { + password: this.newPassword.trim(), + }, }); this.$bkMessage({ message: this.$t('重置密码成功'), @@ -400,13 +357,10 @@ export default { closeResetDialog(e) { if (e.target.innerText === '重置密码') return; this.isShowReset = false; - // 清空 - this.oldPassword = ''; - this.newPassword = ''; }, // 查看密码 - changePasswordInputType(type = 'newPassword') { - this.passwordInputType[type] = this.passwordInputType[type] === 'password' ? 'text' : 'password'; + changePasswordInputType() { + this.passwordInputType = this.passwordInputType === 'password' ? 'text' : 'password'; }, handleLoadAvatarError() { this.localAvatar = this.$store.state.localAvatar;