修复菜单删除bug

This commit is contained in:
TinyAnts 2022-09-14 14:27:58 +08:00
parent 6905fd4fea
commit 978580a005
1 changed files with 8 additions and 2 deletions

View File

@ -186,11 +186,17 @@ public class SystemAuthMenuServiceImpl implements ISystemAuthMenuService {
*/ */
@Override @Override
public void del(Integer id) { public void del(Integer id) {
SystemAuthMenu model = systemAuthMenuMapper.selectOne(new QueryWrapper<SystemAuthMenu>().eq("id", id)); SystemAuthMenu model = systemAuthMenuMapper.selectOne(
new QueryWrapper<SystemAuthMenu>()
.eq("id", id)
.last("limit 1"));
Assert.notNull(model, "菜单已不存在!"); Assert.notNull(model, "菜单已不存在!");
Assert.isNull(systemAuthMenuMapper.selectOne( Assert.isNull(systemAuthMenuMapper.selectOne(
new QueryWrapper<SystemAuthMenu>().eq("pid", id)), new QueryWrapper<SystemAuthMenu>()
.eq("pid", id)
.last("limit 1")),
"请先删除子菜单再操作!"); "请先删除子菜单再操作!");
systemAuthMenuMapper.deleteById(id); systemAuthMenuMapper.deleteById(id);