diff --git a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/RoleServiceImpl.java b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/RoleServiceImpl.java index 4bfbf3f..1269374 100644 --- a/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/RoleServiceImpl.java +++ b/xymanager_service/src/main/java/com/shxy/xymanager_service/impl/RoleServiceImpl.java @@ -11,6 +11,7 @@ import com.shxy.xymanager_common.entity.TbPermissionExample; import com.shxy.xymanager_common.entity.TbRole; import com.shxy.xymanager_common.entity.TbRoleExample; import com.shxy.xymanager_common.enums.PermissionDetailEnum; +import com.shxy.xymanager_common.exception.ApiException; import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.model.PermissionDyLineTreeListModel; import com.shxy.xymanager_dao.dao.DyLevelDao; @@ -59,7 +60,7 @@ public class RoleServiceImpl implements RoleService { @Override public void update(TbRole item) throws Exception { if (item.getId() == SUPER_ADMIN) { - throw new Exception("不能修改超级管理员"); + throw new ApiException("不能修改超级管理员"); } roleMapper.updateByPrimaryKey(item); } @@ -67,7 +68,7 @@ public class RoleServiceImpl implements RoleService { @Override public void delete(Integer id) throws Exception { if (id == SUPER_ADMIN) { - throw new Exception("不能删除超级管理员"); + throw new ApiException("不能删除超级管理员"); } roleMapper.deleteByPrimaryKey(id); } @@ -111,7 +112,7 @@ public class RoleServiceImpl implements RoleService { @Override public void changePermission(Integer roleId, List list) throws Exception { if (roleId == SUPER_ADMIN) { - throw new Exception("不能修改超级管理员的权限"); + throw new ApiException("不能修改超级管理员的权限"); } TbPermissionExample example = new TbPermissionExample(); TbPermissionExample.Criteria criteria = example.createCriteria();