src/main/java/org/springblade/modules/webscoket/WebSocketHandler.java
@@ -104,9 +104,10 @@ //登录链接 String id = jsonObj.get("id").toString(); NettyConfig.getUserChannelMap().put(id,ctx.channel()); NettyConfig.getChannelGroup().add(ctx.channel()); System.out.println(jsonObj.get("type")); System.out.println(jsonObj.get("id")); System.out.println("___________________"+jsonObj.get("type")); System.out.println(jsonObj.get("id")+ "____________________________用户连接成功"); //将用户id作为自定义属性加入到channel 中,方便随时channel中获取用户id AttributeKey<String> key = AttributeKey.valueOf("userId");