mirror of
https://github.com/weizhiqiang1995/erp-pro.git
synced 2025-02-27 17:03:42 +08:00
feat: 解决菜单管理父菜单为自己时出现死循环的问题
This commit is contained in:
parent
4503ab6a8d
commit
e204a68fd2
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@ package com.skyeye.menu.service.impl;
|
|||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.skyeye.annotation.service.SkyeyeService;
|
||||
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
|
||||
|
@ -95,6 +96,14 @@ public class SysEveMenuServiceImpl extends SkyeyeBusinessServiceImpl<SysEveMenuD
|
|||
return beans;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validatorEntity(SysMenu entity) {
|
||||
super.validatorEntity(entity);
|
||||
if (StrUtil.equals(entity.getId(), entity.getParentId())) {
|
||||
throw new CustomException("父菜单不能为自己!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createPrepose(SysMenu entity) {
|
||||
// 设置菜单链接打开类型
|
||||
|
|
Loading…
Reference in a new issue