feat: support first bind update password (#2520)

This commit is contained in:
skynono authored and GitHub committed 2025-12-26 13:59:56 +08:00
1 parent 2570788b46
commit 7379b68f9f
2 files changed
+8 -5

No files matched your search

+4 -1
View File
@@ -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
}