mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-08-29 09:04:14 +00:00
feat: 菜单更新时支持检查是否形成循环依赖
This commit is contained in:
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user