fix 下级部门用户不应该访问到上级树节点
This commit is contained in:
@@ -54,6 +54,22 @@ namespace Ewide.Core
|
||||
if (_rootParentIds.Contains(u.GetPid()))
|
||||
results.Add(u);
|
||||
});
|
||||
|
||||
// 在未获取到根节点的情况下, 直接将最上级作为根节点
|
||||
if (results.Count < 1)
|
||||
{
|
||||
var ids = new List<string>();
|
||||
nodes.ForEach(u => {
|
||||
ids.Add(u.GetId());
|
||||
});
|
||||
|
||||
nodes.ForEach(u =>
|
||||
{
|
||||
if (!ids.Contains(u.GetPid()))
|
||||
results.Add(u);
|
||||
});
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user