This commit is contained in:
昔念
2026-04-23 00:39:29 +08:00
parent b46a1f442b
commit 7fd89800fa
5 changed files with 78 additions and 32 deletions

View File

@@ -437,15 +437,15 @@ func (s *BaseSysUserService) ServiceUpdate(ctx context.Context, req *cool.Update
}
}
}
// 如果请求的password不为空并且密码加密后的值有变动说明要修改密码
var rPassword = r.Get("password", "").String()
if rPassword != "" && rPassword != userInfo["password"].String() {
rMap["password"], _ = gmd5.Encrypt(rPassword)
rMap["passwordV"] = userInfo["passwordV"].Int() + 1
cool.CacheManager.Set(ctx, fmt.Sprintf("admin:passwordVersion:%d", userId), rMap["passwordV"], 0)
} else {
delete(rMap, "password")
}
// // 如果请求的password不为空并且密码加密后的值有变动说明要修改密码
// var rPassword = r.Get("password", "").String()
// if rPassword != "" && rPassword != userInfo["password"].String() {
// rMap["password"], _ = gmd5.Encrypt(rPassword)
// rMap["passwordV"] = userInfo["passwordV"].Int() + 1
// cool.CacheManager.Set(ctx, fmt.Sprintf("admin:passwordVersion:%d", userId), rMap["passwordV"], 0)
// } else {
// delete(rMap, "password")
// }
delete(rMap, "goldbean")
err = g.DB().Transaction(ctx, func(ctx context.Context, tx gdb.TX) (err error) {