From 3adafde3fe18a83cddae813a88f0adad81afb456 Mon Sep 17 00:00:00 2001 From: shizhendong Date: Fri, 25 Oct 2024 16:08:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=B4=E6=97=B6=E5=A4=84=E7=90=86=20a?= =?UTF-8?q?sw=20=E5=92=8C=20opensearch=20=E7=BB=84=E4=BB=B6=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=AF=B9=E5=BA=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/sys/controller/SysAuthController.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/geedge/asw/module/sys/controller/SysAuthController.java b/src/main/java/net/geedge/asw/module/sys/controller/SysAuthController.java index b0e0498..1839031 100644 --- a/src/main/java/net/geedge/asw/module/sys/controller/SysAuthController.java +++ b/src/main/java/net/geedge/asw/module/sys/controller/SysAuthController.java @@ -14,9 +14,7 @@ import net.geedge.asw.module.sys.service.ISysAuthService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.List; import java.util.Map; -import java.util.stream.Collectors; @RestController @RequestMapping("/api/v1") @@ -44,12 +42,13 @@ public class SysAuthController { // payload jwt.setPayload("sub", userEntity.getUserName()); - Map permissions = authService.userPermissions(); - - String roles = ((List) T.JSONUtil.getByPath(T.JSONUtil.parse(permissions), "records.role.name")).stream() - .distinct() - .collect(Collectors.joining(",")); - jwt.setPayload("roles", roles); +// Map permissions = authService.userPermissions(); +// +// String roles = ((List) T.JSONUtil.getByPath(T.JSONUtil.parse(permissions), "records.role.name")).stream() +// .distinct() +// .collect(Collectors.joining(",")); + // TODO asw and opensearch role mapping + jwt.setPayload("roles", "admin"); Long eff = Long.valueOf(jwt.getPayload("eff").toString()); jwt.setPayload("exp", eff == -1L ? -1 : (eff / 1000));