diff --git a/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs b/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs index 495d05e0..dbb84f98 100644 --- a/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs +++ b/Src/Dlhis.Sys/Menu/Services/Implements/MenuService.cs @@ -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 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(); } var allMenus = await _dbContext.Queryable() @@ -311,5 +317,5 @@ public class MenuService : IMenuService } } - + } \ No newline at end of file