fix: 修复菜单修改问题
This commit is contained in:
@@ -190,8 +190,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|||||||
public void update(SysMenu resources) {
|
public void update(SysMenu resources) {
|
||||||
String menuId = resources.getMenu_id();
|
String menuId = resources.getMenu_id();
|
||||||
SysMenu menu = baseMapper.selectById(menuId);
|
SysMenu menu = baseMapper.selectById(menuId);
|
||||||
List<String> allChildIds = Arrays.asList(baseMapper.findAllChild(menuId).split(","));
|
String allChild = baseMapper.findAllChild(menuId); // 获取当前菜单的所有子菜单
|
||||||
if (allChildIds.contains(resources.getPid())){
|
List<String> allChildIds = ObjectUtil.isNotEmpty(allChild)?Arrays.asList(allChild.split(",")):null;
|
||||||
|
if (ObjectUtil.isNotEmpty(allChildIds) && allChildIds.contains(resources.getPid())){
|
||||||
throw new BadRequestException("上级不能为自己或自己的下级");
|
throw new BadRequestException("上级不能为自己或自己的下级");
|
||||||
}
|
}
|
||||||
if (resources.getIframe()) {
|
if (resources.getIframe()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user