fix 菜单查看调整

This commit is contained in:
2024-03-23 21:02:28 +08:00
parent 6f1100cb84
commit ec28fe5b85

View File

@@ -1,4 +1,5 @@
using Dlhis.Entity.Sys.Entities;
using System.ComponentModel.DataAnnotations;
using Dlhis.Entity.Sys.Entities;
using Dlhis.Entity.Sys.Enums;
using Dlhis.Sys.Identity.Services;
using Dlhis.Sys.Menu.Request;
@@ -41,7 +42,7 @@ public class MenuService : IMenuService
return top;
}
public async Task<string> SaveMenuAsync(SaveMenuRequest request)
{
await CheckAsync(request);
@@ -149,7 +150,12 @@ public class MenuService : IMenuService
var allCodes = await GetAllAssignmentCodesAsync();
if (!allCodes.Any())
{
return await GetListAsync(PlatformEnumType.PCAdmin);
var userId = _currentUser.GetIntSubjectId();
if (userId == 1)
{
return await GetListAsync(PlatformEnumType.PCAdmin);
}
return new List<MenuResponse>();
}
var allMenus = await _dbContext.Queryable<MenuEntity>()
@@ -311,5 +317,5 @@ public class MenuService : IMenuService
}
}
}