feat: 菜单更新时支持检查是否形成循环依赖

This commit is contained in:
DaxPay
2025-02-17 15:44:15 +08:00
parent 5935688f8e
commit 52769e630a

View File

@@ -121,13 +121,13 @@ public class PermMenuService {
* @return 是否为下级菜单
*/
private boolean isDescendant(PermMenuResult menu, Long pid) {
if (CollUtil.isEmpty(menu.getChildren())) {
return false;
}
// 如果是否为自身
if (Objects.equals(menu.getId(), pid)) {
return true;
}
if (CollUtil.isEmpty(menu.getChildren())) {
return false;
}
// 检测是否为子孙菜单
for (var child : menu.getChildren()) {
if (child.getId().equals(pid)) {