From d812eeae7291701dc1c9dda7bcfed89df9f336b8 Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期四, 16 六月 2022 09:23:35 +0800 Subject: [PATCH] 登录检查bug修复 --- src/main/java/com/whyc/config/WebSocketConfig.java | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/whyc/config/WebSocketConfig.java b/src/main/java/com/whyc/config/WebSocketConfig.java index 8bf2007..f6da3ce 100644 --- a/src/main/java/com/whyc/config/WebSocketConfig.java +++ b/src/main/java/com/whyc/config/WebSocketConfig.java @@ -19,7 +19,9 @@ public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) { //HttpSession httpSession = (ShiroHttpSession) request.getHttpSession(); HttpSession httpSession = (HttpSession)request.getHttpSession(); - sec.getUserProperties().put("httpSession",httpSession); + if(httpSession!=null) { + sec.getUserProperties().put("httpSession", httpSession); + } super.modifyHandshake(sec, request, response); } -- Gitblit v1.9.1