mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 密码修改禁止与初始密码一致
This commit is contained in:
parent
99d329967c
commit
cdf3f8cdd0
@ -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' });
|
||||
|
@ -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'));
|
||||
|
@ -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…
x
Reference in New Issue
Block a user