Browse Source

修改配置

pull/24/head
chenjiandong 2 years ago
parent
commit
a6f2906fae
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/main/java/com/tuoheng/gateway/config/GatewayFilterConfig.java

+ 3
- 0
src/main/java/com/tuoheng/gateway/config/GatewayFilterConfig.java View File

@@ -51,6 +51,7 @@ public class GatewayFilterConfig implements GlobalFilter, Ordered {
List<Integer> roleIds = permissionMap.get(requestUrl);*/
//todo:获取当前系统、当前接口 可以访问的角色集合 end
String token = getToken(exchange);
System.out.println("登录人token:" + token);
String username = null;
Long oUserId = null;
List<String> authorityList = new ArrayList<>();
@@ -59,7 +60,9 @@ public class GatewayFilterConfig implements GlobalFilter, Ordered {
//token数据解析
DecodedJWT decodedJWT = JWT.decode(token);
username = decodedJWT.getClaim(USERNAME).asString();
System.out.println("登录人username:" + username);
oUserId = decodedJWT.getClaim(OUSERID).asLong();
System.out.println("登录人oUserId:" + oUserId);
authorityList = decodedJWT.getClaim(SCOPE).asList(String.class);
clientUserRoleDtoList = decodedJWT.getClaim(CLIENTROLELIST).asList(ClientUserRoleDto.class);
}

Loading…
Cancel
Save