fix(user):补充清理用户部分的缓存。

This commit is contained in:
徐涛 2023-06-08 21:08:36 +08:00
parent 28b1478e9a
commit 62560e4eeb

View File

@ -48,7 +48,7 @@ func (ur _UserRepository) FindUserByUsername(username string) (*model.User, erro
ur.log.Error("从数据库查询指定用户名的用户基本信息失败。", zap.String("username", username), zap.Error(err))
return nil, err
}
cache.CacheEntity(user, []string{"user", fmt.Sprintf("user:%s", username)}, "user", username)
cache.CacheEntity(user, []string{"user", fmt.Sprintf("user:%s", username), fmt.Sprintf("user:%s", user.Id)}, "user", username)
return &user, nil
}