浏览代码

修改配置

pull/24/head
chenjiandong 2 年前
父节点
当前提交
a6f2906fae
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      src/main/java/com/tuoheng/gateway/config/GatewayFilterConfig.java

+ 3
- 0
src/main/java/com/tuoheng/gateway/config/GatewayFilterConfig.java 查看文件

@@ -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);
}

正在加载...
取消
保存