Merge pull request #94 from lm0303/main

将废弃的ServerHandshakeStateEvent.HANDSHAKE_COMPLETE升级为HandshakeComplete
This commit is contained in:
zongzibinbin
2023-07-06 22:38:58 +08:00
committed by GitHub
3 changed files with 3 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ public class JwtUtils {
DecodedJWT jwt = verifier.verify(token); DecodedJWT jwt = verifier.verify(token);
return jwt.getClaims(); return jwt.getClaims();
} catch (Exception e) { } catch (Exception e) {
log.info("decode error,token:{}", token, e); log.error("decode error,token:{}", token, e);
} }
return null; return null;
} }

View File

@@ -38,4 +38,5 @@ public interface LoginService {
* @return * @return
*/ */
Long getValidUid(String token); Long getValidUid(String token);
} }

View File

@@ -67,7 +67,7 @@ public class NettyWebSocketServerHandler extends SimpleChannelInboundHandler<Tex
// 关闭用户的连接 // 关闭用户的连接
userOffLine(ctx); userOffLine(ctx);
} }
} else if (evt == WebSocketServerProtocolHandler.ServerHandshakeStateEvent.HANDSHAKE_COMPLETE) { } else if (evt instanceof WebSocketServerProtocolHandler.HandshakeComplete) {
this.webSocketService.connect(ctx.channel()); this.webSocketService.connect(ctx.channel());
String token = NettyUtil.getAttr(ctx.channel(), NettyUtil.TOKEN); String token = NettyUtil.getAttr(ctx.channel(), NettyUtil.TOKEN);
if (StrUtil.isNotBlank(token)) { if (StrUtil.isNotBlank(token)) {