解决无法查看截图问题

This commit is contained in:
392431041@qq.com 2020-04-07 21:33:44 +08:00
parent d7ea8a171f
commit 23e9b162b2
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());