Browse Source

fix: 密码修改禁止与初始密码一致

pull/57/head
ssongliu 2 years ago committed by ssongliu
parent
commit
cdf3f8cdd0
  1. 6
      frontend/src/views/setting/expired.vue
  2. 2
      frontend/src/views/setting/index.vue
  3. 4
      frontend/src/views/setting/tabs/panel.vue

6
frontend/src/views/setting/expired.vue

@ -115,12 +115,12 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
formEl.validate(async (valid) => {
if (!valid) return;
if (settingForm.complexityVerification === 'disable' && passForm.newPassword === passForm.oldPassword) {
let password =
settingForm.complexityVerification === 'disable' ? passForm.newPassword : passForm.newPasswordComplexity;
if (password === passForm.oldPassword) {
ElMessage.error(i18n.global.t('setting.duplicatePassword'));
return;
}
let password =
settingForm.complexityVerification === 'disable' ? passForm.newPassword : passForm.newPasswordComplexity;
await handleExpired({ oldPassword: passForm.oldPassword, newPassword: password });
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
router.push({ name: 'home' });

2
frontend/src/views/setting/index.vue

@ -116,7 +116,7 @@ const SaveSetting = async (formEl: FormInstance | undefined, key: string, val: a
}
let param = {
key: key,
value: val,
value: val + '',
};
await updateSetting(param);
ElMessage.success(i18n.t('commons.msg.operationSuccess'));

4
frontend/src/views/setting/tabs/panel.vue

@ -252,6 +252,10 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
form.settingInfo.complexityVerification === 'disable'
? passForm.newPassword
: passForm.newPasswordComplexity;
if (password === passForm.oldPassword) {
ElMessage.error(i18n.global.t('setting.duplicatePassword'));
return;
}
await updatePassword({ oldPassword: passForm.oldPassword, newPassword: password });
passwordVisiable.value = false;
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));

Loading…
Cancel
Save