From cdf3f8cdd06759dadfd300244000bfa8642cde48 Mon Sep 17 00:00:00 2001 From: ssongliu Date: Thu, 1 Dec 2022 19:30:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E4=B8=8E=E5=88=9D=E5=A7=8B=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/setting/expired.vue | 6 +++--- frontend/src/views/setting/index.vue | 2 +- frontend/src/views/setting/tabs/panel.vue | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/setting/expired.vue b/frontend/src/views/setting/expired.vue index 721a58255..834c0ae8e 100644 --- a/frontend/src/views/setting/expired.vue +++ b/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' }); diff --git a/frontend/src/views/setting/index.vue b/frontend/src/views/setting/index.vue index a98d73ebc..f6b8e0a0b 100644 --- a/frontend/src/views/setting/index.vue +++ b/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')); diff --git a/frontend/src/views/setting/tabs/panel.vue b/frontend/src/views/setting/tabs/panel.vue index 5ad52bfbc..d3886571e 100644 --- a/frontend/src/views/setting/tabs/panel.vue +++ b/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'));