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 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 buttons = (from x in db.Sys_ButtonToMenu
join y in db.Sys_ButtonPower on x.ButtonToMenuId equals y.ButtonToMenuId join y in db.Sys_ButtonPower on x.ButtonToMenuId equals y.ButtonToMenuId
where roleIdList.Contains(y.RoleId) && y.MenuId == menuId && x.MenuId == menuId where roleIdList.Contains(y.RoleId) && y.MenuId == menuId && x.MenuId == menuId
select x).ToList(); select x).ToList();
} }
} }
}
if (buttons.Count() > 0) if (buttons.Count() > 0)
{ {