fix: 调整报错

dev
huangfeng 1 year ago
parent 930d8060df
commit 9943727b77

@ -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<TbPermission> list) throws Exception {
if (roleId == SUPER_ADMIN) {
throw new Exception("不能修改超级管理员的权限");
throw new ApiException("不能修改超级管理员的权限");
}
TbPermissionExample example = new TbPermissionExample();
TbPermissionExample.Criteria criteria = example.createCriteria();

Loading…
Cancel
Save