mirror of
https://github.com/BgaSol/sol-cloud
synced 2026-04-21 17:17:16 +00:00
fix(system-service): allow findAll when not logged in
This commit is contained in:
parent
5a40395754
commit
36c98c75d3
2 changed files with 8 additions and 0 deletions
|
|
@ -52,6 +52,10 @@ public class DepartmentService extends BaseTreeService<DepartmentEntity, BasePag
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<DepartmentEntity> findAll(boolean otherData) {
|
||||
if (!StpUtil.isLogin()) {
|
||||
// 未登录,可能是服务远程调用,直接返回全部
|
||||
return super.findAll(otherData);
|
||||
}
|
||||
List<String> roleList = StpUtil.getRoleList();
|
||||
if (roleList.contains(ADMIN_ROLE_ID)) {
|
||||
return super.findAll(otherData);
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ public class RoleService extends BaseService<RoleEntity, BasePageDto<RoleEntity>
|
|||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
public List<RoleEntity> findAll(boolean otherData) {
|
||||
if (!StpUtil.isLogin()) {
|
||||
// 未登录,可能是服务远程调用,直接返回全部
|
||||
return super.findAll(otherData);
|
||||
}
|
||||
List<String> roleList = StpUtil.getRoleList();
|
||||
if (roleList.contains(ADMIN_ROLE_ID)) {
|
||||
return super.findAll(otherData);
|
||||
|
|
|
|||
Loading…
Reference in a new issue