diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.SqlSugarCore/Repositories/DiscussLableRepository.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.SqlSugarCore/Repositories/DiscussLableRepository.cs index 8a2020a8..6793f6c4 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.SqlSugarCore/Repositories/DiscussLableRepository.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.SqlSugarCore/Repositories/DiscussLableRepository.cs @@ -1,4 +1,5 @@ using Mapster; +using Microsoft.Extensions.Caching.Distributed; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; using Yi.Framework.Bbs.Domain.Entities.Forum; @@ -28,10 +29,13 @@ public class DiscussLableRepository : SqlSugarRepository> GetDiscussLableCacheMapAsync() { var cahce = await _lableCache.GetOrAddAsync(DiscussLableConst.DiscussLableCacheKey, async () => - { - var entities = await _DbQueryable.ToListAsync(); - return entities.Adapt>(); - }); + { + var entities = await _DbQueryable.ToListAsync(); + return entities.Adapt>(); + }, () => + new DistributedCacheEntryOptions() + { AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(2) } + ); return cahce.ToDictionary(x => x.Id); } } \ No newline at end of file diff --git a/Yi.Bbs.Vue3/src/components/InfoCard.vue b/Yi.Bbs.Vue3/src/components/InfoCard.vue index ccb24c20..7e8a45c3 100644 --- a/Yi.Bbs.Vue3/src/components/InfoCard.vue +++ b/Yi.Bbs.Vue3/src/components/InfoCard.vue @@ -11,7 +11,7 @@ const onClickText=()=>{