洪城义警-正式版后台
zengh
2022-02-22 6d1c495c50d6e1ed6044ed28be3f76e7d536b77a
src/main/java/org/springblade/modules/webscoket/WebSocketHandler.java
@@ -105,8 +105,8 @@
            String id = jsonObj.get("id").toString();
            NettyConfig.getUserChannelMap().put(id,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");
@@ -114,11 +114,6 @@
            //把用户信息添加到通道里
            ChannelSupervise.addChannel(ctx.channel(),id);
         }
      }