Skip to content

Commit 4cf3956

Browse files
committed
[fix] 菜单获取错误修复
1 parent cd8f115 commit 4cf3956

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Ape.Volo.Business/Permission/MenuService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ public async Task<List<ExportBase>> DownloadAsync(MenuQueryCriteria menuQueryCri
263263

264264
public async Task<List<MenuDto>> QueryAllAsync()
265265
{
266-
var menuDtos = await ApeContext.Cache.GetAsync<List<MenuDto>>("menus:LoadAllMenu");
267-
if (menuDtos.Any())
266+
var menuDtos = await ApeContext.Cache.GetAsync<List<MenuDto>>(GlobalConstants.CachePrefix.LoadAllMenu);
267+
if (menuDtos != null && menuDtos.Count != 0)
268268
{
269269
return menuDtos;
270270
}
271271

272272
menuDtos = ApeContext.Mapper.Map<List<MenuDto>>(await Table.ToListAsync());
273-
if (menuDtos.Any())
273+
if (menuDtos.Count != 0)
274274
{
275275
await ApeContext.Cache.SetAsync(GlobalConstants.CachePrefix.LoadAllMenu, menuDtos,
276276
TimeSpan.FromSeconds(120), null);

0 commit comments

Comments
 (0)