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,24 +216,21 @@ namespace BLL
}
else
{
List<string> roleIdList = new List<string>();
if (string.IsNullOrEmpty(projectId))
{
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();
roleIdList = user.RoleId.Split(',').ToList();
}
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();
}
}
}
if (buttons.Count() > 0)
{