fix: 修复未输入新密码时提示修改成功
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user