角色管理页面1)修复bug,先中角色中全部菜单菜单中会包含已选过的菜单的子菜单的第一个页面

2)添加不可重复添加同角色名的角色校验
This commit is contained in:
maqiao 2023-11-13 17:15:55 +08:00
parent 993b25c63c
commit f1e77d2e84
1 changed files with 1 additions and 1 deletions

View File

@ -117,7 +117,7 @@ namespace DM_Weight.ViewModels
{ {
int i = p.Children.ToList().FindIndex(it4 => it4.Id == it3.Id); int i = p.Children.ToList().FindIndex(it4 => it4.Id == it3.Id);
//if (i > 0 && AllPremissions.ElementAt(index).Children.Count > i) //if (i > 0 && AllPremissions.ElementAt(index).Children.Count > i)
if (p.Children[i] != null) if (p.Children.Count > 0 && i >= 0 && p.Children[i] != null)
{ {
AllPremissions.ElementAt(index).Children.RemoveAt(i); AllPremissions.ElementAt(index).Children.RemoveAt(i);
} }