mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 00:46:42 +00:00
feat: support first bind update password (#2520)
This commit is contained in:
@@ -763,7 +763,10 @@ func checkUpdatePassword(originalPassword string, newPassword string, userId int
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !common.ValidatePasswordAndHash(originalPassword, currentUser.Password) {
|
||||
|
||||
// 密码不为空,需要验证原密码
|
||||
// 支持第一次账号绑定时原密码为空的情况
|
||||
if !common.ValidatePasswordAndHash(originalPassword, currentUser.Password) && currentUser.Password != "" {
|
||||
err = fmt.Errorf("原密码错误")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -314,10 +314,10 @@ const PersonalSetting = () => {
|
||||
};
|
||||
|
||||
const changePassword = async () => {
|
||||
if (inputs.original_password === '') {
|
||||
showError(t('请输入原密码!'));
|
||||
return;
|
||||
}
|
||||
// if (inputs.original_password === '') {
|
||||
// showError(t('请输入原密码!'));
|
||||
// return;
|
||||
// }
|
||||
if (inputs.set_new_password === '') {
|
||||
showError(t('请输入新密码!'));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user