增加删掉除验证规则

This commit is contained in:
TinyAnts 2022-08-01 15:48:39 +08:00
parent cb031d6ae1
commit cd89b9932b
2 changed files with 6 additions and 2 deletions

View File

@ -182,8 +182,11 @@ public class SystemMenuServiceImpl implements ISystemMenuService {
SystemMenu model = systemMenuMapper.selectOne(new QueryWrapper<SystemMenu>().eq("id", id));
Assert.notNull(model, "菜单已不存在!");
systemMenuMapper.deleteById(id);
Assert.isNull(systemMenuMapper.selectOne(
new QueryWrapper<SystemMenu>().eq("pid", id)),
"请先删除子菜单再操作!");
systemMenuMapper.deleteById(id);
iSystemRoleMenuService.batchDeleteByMenuId(id);
RedisUtil.del(AdminConfig.backstageRolesKey);
}

View File

@ -128,7 +128,8 @@ public class SystemRoleServiceImpl implements ISystemRoleService {
model.setCreateTime(System.currentTimeMillis() / 1000);
model.setUpdateTime(System.currentTimeMillis() / 1000);
systemRoleMapper.insert(model);
System.out.println(model.getId());
System.out.println(systemRoleParam.getMenuIds());
iSystemRoleMenuService.batchSaveByMenuIds(model.getId(), systemRoleParam.getMenuIds());
}