From 55252345da33b4ce5cf5912fb18d01aa38b3517b Mon Sep 17 00:00:00 2001 From: aiwenmo <32723967+aiwenmo@users.noreply.github.com> Date: Wed, 1 Nov 2023 09:31:40 +0800 Subject: [PATCH] [Fix-1662] [admin] OpenApi notLoginException (#2470) Co-authored-by: wenmo <32723967+wenmo@users.noreply.github.com> --- .../main/java/org/dinky/service/impl/UserServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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