fix: 修复未输入新密码时提示修改成功

This commit is contained in:
creamlike1024
2025-05-06 22:28:32 +08:00
parent 0cf4c59d22
commit d859e3fa64
2 changed files with 29 additions and 12 deletions

View File

@@ -616,9 +616,6 @@ func UpdateSelf(c *gin.Context) {
}
func checkUpdatePassword(originalPassword string, newPassword string, userId int) (updatePassword bool, err error) {
if newPassword == "" {
return
}
var currentUser *model.User
currentUser, err = model.GetUserById(userId, true)
if err != nil {
@@ -628,6 +625,9 @@ func checkUpdatePassword(originalPassword string, newPassword string, userId int
err = fmt.Errorf("原密码错误")
return
}
if newPassword == "" {
return
}
updatePassword = true
return
}