From 9943727b7775fcf3e9db218bc6059b92418ba712 Mon Sep 17 00:00:00 2001 From: huangfeng Date: Wed, 28 Feb 2024 16:03:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/shxy/xymanager_service/impl/RoleServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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();