diff --git a/dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java b/dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java index 21569f6619..5d8f3d49d8 100644 --- a/dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java +++ b/dinky-admin/src/main/java/org/dinky/service/impl/UserServiceImpl.java @@ -355,7 +355,10 @@ public Boolean checkTenantAdmin(Integer id) { @Override public List getCurrentRole() { - return roleService.getRoleByUserId(StpUtil.getLoginIdAsInt()); + if (StpUtil.isLogin()) { + return roleService.getRoleByUserId(StpUtil.getLoginIdAsInt()); + } + return new ArrayList<>(); } @Override