This commit is contained in:
夏菊 2025-10-22 17:47:39 +08:00
parent 097e48459f
commit 53230dc06f
2 changed files with 7 additions and 10 deletions

View File

@ -216,22 +216,19 @@ namespace BLL
} }
else else
{ {
List<string> roleIdList = new List<string>();
if (string.IsNullOrEmpty(projectId)) if (string.IsNullOrEmpty(projectId))
{ {
roleIdList = user.RoleId.Split(',').ToList();
buttons = (from x in db.Sys_ButtonToMenu
join y in db.Sys_ButtonPower on x.ButtonToMenuId equals y.ButtonToMenuId
where y.RoleId == user.RoleId && y.MenuId == menuId && x.MenuId == menuId
select x).ToList();
} }
else else
{ {
List<string> roleIdList = UserService.GetRoleListByProjectIdUserId(projectId, userId); roleIdList = UserService.GetRoleListByProjectIdUserId(projectId, userId);
buttons = (from x in db.Sys_ButtonToMenu
join y in db.Sys_ButtonPower on x.ButtonToMenuId equals y.ButtonToMenuId
where roleIdList.Contains(y.RoleId) && y.MenuId == menuId && x.MenuId == menuId
select x).ToList();
} }
buttons = (from x in db.Sys_ButtonToMenu
join y in db.Sys_ButtonPower on x.ButtonToMenuId equals y.ButtonToMenuId
where roleIdList.Contains(y.RoleId) && y.MenuId == menuId && x.MenuId == menuId
select x).ToList();
} }
} }