Commit a6cc690e authored by AfirSraftGarrier's avatar AfirSraftGarrier

Merge remote-tracking branch 'origin/m33' into for-yx

parents 5871464f 8e4794fb
......@@ -111,7 +111,7 @@ public class DeviceServerHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception{
// TODO Auto-generated method stub
super.exceptionCaught(ctx, cause);
log.debug("设备服务器,exceptionCaught:{}", ctx.channel().id().asLongText());
......
......@@ -32,7 +32,7 @@ public class User implements Serializable {
private Integer userId;
@ApiModelProperty("密码")
private String password;
private transient String password;
@ApiModelProperty("用户名")
private String userName;
......
......@@ -94,7 +94,7 @@ public class ForwardClientHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public synchronized void userEventTriggered(ChannelHandlerContext ctx, Object obj) throws Exception {
public synchronized void userEventTriggered(ChannelHandlerContext ctx, Object obj) {
log.debug("桥接客户端,userEventTriggered:{}", ctx.channel().id().asLongText());
}
......
......@@ -17,7 +17,7 @@ import lombok.extern.slf4j.Slf4j;
public class ForwardConnectionListener extends BaseConnectionListener {
@Override
public void operationComplete(ChannelFuture channelFuture) throws Exception {
public void operationComplete(ChannelFuture channelFuture) {
AlarmService alarmService = SpringUtil.getBean(AlarmService.class);
if (!channelFuture.isSuccess()) {
//TODO 失败进行告警
......
......@@ -21,14 +21,14 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
UserUtils.removeUser();
UserUtils.removeUri();
}
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
response.setHeader("Set-Cookie","HttpOnly");
return true;
}
......
......@@ -66,7 +66,13 @@ public class JwtUtil {
*/
public static DecodedJWT verifyToken(String token) {
JWTVerifier verifier = JWT.require(Algorithm.HMAC256(SECRET)).build();
DecodedJWT jwt = verifier.verify(token);
DecodedJWT jwt = null;
try {
jwt = verifier.verify(token);
} catch ( RuntimeException e) {
log.error(e.getMessage());
log.error("解析编码异常");
}
return jwt;
}
}
......@@ -2,13 +2,15 @@ package iot.sixiang.license.net;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class BaseChannelInitializer extends ChannelInitializer<SocketChannel> {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
// TODO Auto-generated method stub
System.out.println("重写了initChannel方法");
log.info("重写了initChannel方法");
}
}
......@@ -3,16 +3,18 @@ package iot.sixiang.license.net;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Data
@Slf4j
public class BaseConnectionListener implements ChannelFutureListener {
public String appId;
public String host;
public int port;
@Override
public void operationComplete(ChannelFuture future) throws Exception {
public void operationComplete(ChannelFuture future) {
// TODO Auto-generated method stub
System.out.println("重写了operationComplete方法");
log.info("重写了operationComplete方法");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment