From bd989c804911b5ba0e28aa7d7dc2183f39e30a2f Mon Sep 17 00:00:00 2001
From: lxw <810412026@qq.com>
Date: 星期四, 06 四月 2023 11:34:54 +0800
Subject: [PATCH] 领导层首页修改

---
 src/main/java/com/whyc/webSocket/HomeAdminSocket.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/whyc/webSocket/HomeAdminSocket.java b/src/main/java/com/whyc/webSocket/HomeAdminSocket.java
index 55c61f3..7679a79 100644
--- a/src/main/java/com/whyc/webSocket/HomeAdminSocket.java
+++ b/src/main/java/com/whyc/webSocket/HomeAdminSocket.java
@@ -6,10 +6,12 @@
 import com.whyc.pojo.Battinf;
 import com.whyc.pojo.PowerInf;
 import com.whyc.pojo.StationInf;
+import com.whyc.pojo.UserInf;
 import com.whyc.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.servlet.http.HttpSession;
 import javax.websocket.*;
 import javax.websocket.server.ServerEndpoint;
 import java.util.HashMap;
@@ -77,10 +79,10 @@
     @OnOpen
     public void onOpen(Session session, EndpointConfig config) {
         this.session = session;
-        /*HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
+        HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession");
         UserInf user = (UserInf) httpSession.getAttribute("user");
-        final int userId = user.getUId().intValue();*/
-        final int userId = 1087;
+        final int userId = user.getUId().intValue();
+        //final int userId = 1087;
         Thread thread = new Thread() {
             @Override
             public void run() {

--
Gitblit v1.9.1