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
commit 161e2de4dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

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

View File

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

View File

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