!18 解决无法查看截图问题

Merge pull request !18 from Flever_fj/master
This commit is contained in:
seagull 2020-04-08 08:23:20 +08:00 committed by Gitee
commit 537a34df61
1 changed files with 3 additions and 3 deletions

View File

@ -67,14 +67,14 @@ public class ClientHandler extends ChannelHandlerAdapter {
@Override @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws UnsupportedEncodingException { public void channelRead(ChannelHandlerContext ctx, Object msg) throws UnsupportedEncodingException {
//统一转编码 //统一转编码
String jsonStr = URLDecoder.decode(msg.toString(), "GBK");
//服务端消息处理,如果接收到测试任务方法则直接产生一个http请求并发送请求到本地 //服务端消息处理,如果接收到测试任务方法则直接产生一个http请求并发送请求到本地
String jsonStr = msg.toString();
JSONObject json; JSONObject json;
try { try {
json = JSON.parseObject(jsonStr); json = JSON.parseObject(msg.toString());
} catch (Exception e) { } catch (Exception e) {
log.error("收到服务端非Json消息,但是异常:" + jsonStr); log.error("收到服务端非Json消息,但是异常:" + msg);
return; return;
} }
log.info("收到服务端消息:" + json.toString()); log.info("收到服务端消息:" + json.toString());