whyclxw
2024-04-28 b25b814a949d2065a61fd3167206ffb51a57af65
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);
    }