mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
Merge pull request #94 from lm0303/main
将废弃的ServerHandshakeStateEvent.HANDSHAKE_COMPLETE升级为HandshakeComplete
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,5 @@ public interface LoginService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Long getValidUid(String token);
|
Long getValidUid(String token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user