Browse Source

添加条件判断

gao.qiang 1 year ago
parent
commit
43df4bc825

+ 6 - 3
base-system/src/main/java/com/ozs/system/service/impl/SysRoleServiceImpl.java

@@ -192,9 +192,12 @@ public class SysRoleServiceImpl extends JoinServiceImpl<SysRoleMapper, SysRole>
         if (!SysUser.isAdmin(SecurityUtils.getId())) {
             SysRole role = new SysRole();
             role.setRoleId(roleId);
-            List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
-            if (StringUtils.isEmpty(roles)) {
-                throw new ServiceException("没有权限访问角色数据!");
+            SysRole sysRole = baseMapper.selectRoleById(roleId);
+            if ("2".equals(sysRole.getStatus())) {
+                List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
+                if (StringUtils.isEmpty(roles)) {
+                    throw new ServiceException("没有权限访问角色数据!");
+                }
             }
         }
     }