|
@@ -95,7 +95,7 @@ public class NettyServer implements ApplicationRunner {
|
|
protected void channelRead0(ChannelHandlerContext ctx, TextWebSocketFrame msg) throws Exception {
|
|
protected void channelRead0(ChannelHandlerContext ctx, TextWebSocketFrame msg) throws Exception {
|
|
log.info("收到登录请求,开始验证state:" + msg.text());
|
|
log.info("收到登录请求,开始验证state:" + msg.text());
|
|
// 收到登录请求,根据安全认证state调用登录验证方法
|
|
// 收到登录请求,根据安全认证state调用登录验证方法
|
|
- ResponseJson responseJson = loginService.nettyAuthorization(msg.text());
|
|
|
|
|
|
+ ResponseJson responseJson = loginService.checkScanAuthResult(msg.text());
|
|
Integer count = 0;
|
|
Integer count = 0;
|
|
// 若验证返回码不为0且验证次数小于60次,重新调用验证
|
|
// 若验证返回码不为0且验证次数小于60次,重新调用验证
|
|
while (responseJson.getCode() != 0 && count<60) {
|
|
while (responseJson.getCode() != 0 && count<60) {
|
|
@@ -104,7 +104,7 @@ public class NettyServer implements ApplicationRunner {
|
|
ctx.channel().writeAndFlush(new TextWebSocketFrame("验证结果:" + responseJson.getCode() + "-" + responseJson.getMsg()));
|
|
ctx.channel().writeAndFlush(new TextWebSocketFrame("验证结果:" + responseJson.getCode() + "-" + responseJson.getMsg()));
|
|
Thread.sleep(1000);
|
|
Thread.sleep(1000);
|
|
// 重新调用登录验证方法
|
|
// 重新调用登录验证方法
|
|
- responseJson = loginService.nettyAuthorization(msg.text());
|
|
|
|
|
|
+ responseJson = loginService.checkScanAuthResult(msg.text());
|
|
}
|
|
}
|
|
ctx.channel().writeAndFlush(new TextWebSocketFrame("验证结果:" + responseJson.getCode() + "-" + responseJson.getMsg()));
|
|
ctx.channel().writeAndFlush(new TextWebSocketFrame("验证结果:" + responseJson.getCode() + "-" + responseJson.getMsg()));
|
|
// 关闭连接
|
|
// 关闭连接
|