Merge branch 'refs/heads/abp' into digital-collectibles

This commit is contained in:
橙子
2024-12-10 00:06:14 +08:00
4 changed files with 20 additions and 8 deletions

View File

@@ -116,7 +116,9 @@ namespace Yi.Framework.Bbs.Application.Services.Analyses
)
.ToPageListAsync(pageIndex, input.MaxResultCount, total);
output.ForEach(x => { x.LevelName = _bbsUserManager._levelCacheDic[x.Level].Name; });
var levelCache = await _bbsUserManager.GetLevelCacheMapAsync();
output.ForEach(x => { x.LevelName = levelCache[x.Level].Name; });
return new PagedResultDto<MoneyTopUserDto>
{
Items = output,

View File

@@ -158,10 +158,11 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
//查询完主题之后,要过滤一下私有的主题信息
items.ApplyPermissionTypeFilter(CurrentUser.Id ?? Guid.Empty);
var levelCacheDic= await _bbsUserManager.GetLevelCacheMapAsync();
//等级、是否点赞赋值
items?.ForEach(x =>
{
x.User.LevelName = _bbsUserManager._levelCacheDic[x.User.Level].Name;
x.User.LevelName = levelCacheDic[x.User.Level].Name;
if (CurrentUser.Id is not null)
{
//默认fasle
@@ -212,7 +213,8 @@ namespace Yi.Framework.Bbs.Application.Services.Forum
}
}, true)
.ToListAsync();
output?.ForEach(x => x.User.LevelName = _bbsUserManager._levelCacheDic[x.User.Level].Name);
var levelCacheDic= await _bbsUserManager.GetLevelCacheMapAsync();
output?.ForEach(x => x.User.LevelName = levelCacheDic[x.User.Level].Name);
return output;
}