mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-10-15 06:10:26 +00:00
feat: 菜单更新时支持检查是否形成循环依赖
This commit is contained in:
@@ -121,13 +121,13 @@ public class PermMenuService {
|
|||||||
* @return 是否为下级菜单
|
* @return 是否为下级菜单
|
||||||
*/
|
*/
|
||||||
private boolean isDescendant(PermMenuResult menu, Long pid) {
|
private boolean isDescendant(PermMenuResult menu, Long pid) {
|
||||||
if (CollUtil.isEmpty(menu.getChildren())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 如果是否为自身
|
// 如果是否为自身
|
||||||
if (Objects.equals(menu.getId(), pid)) {
|
if (Objects.equals(menu.getId(), pid)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (CollUtil.isEmpty(menu.getChildren())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// 检测是否为子孙菜单
|
// 检测是否为子孙菜单
|
||||||
for (var child : menu.getChildren()) {
|
for (var child : menu.getChildren()) {
|
||||||
if (child.getId().equals(pid)) {
|
if (child.getId().equals(pid)) {
|
||||||
|
Reference in New Issue
Block a user