From e1ac085b28440871c9639a63615b7a0f1081e6f3 Mon Sep 17 00:00:00 2001 From: wuyouming666 <2265557248@qq.com> Date: 星期二, 05 九月 2023 15:13:59 +0800 Subject: [PATCH] 1、Plcaction类 接收前端message并 writeword 同时每10秒readword 发送给前端并渲染 2、用户token 设置为一天 ,超时自动跳转到登录页面 3、layout布局el-head 高度调整 --- springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java index abf3fff..6eae7f5 100644 --- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java +++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java @@ -2,9 +2,6 @@ import java.util.List; -import javax.websocket.Session; - -import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; public class PlcHold extends Thread { @@ -13,7 +10,7 @@ while (this != null) { try { - Thread.sleep(15000); + Thread.sleep(2000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -26,11 +23,19 @@ //鎺ㄩ�佸埌鍓嶇 JSONObject jsonObject = new JSONObject(); - jsonObject.append("params", new short[] { 0, 1, 2, 3, 4, 5, }); + jsonObject.append("params", new short[] { 0, 1, 2, 3, 4, 5 }); WebSocketServer sendwServer = WebSocketServer.sessionMap.get("talkvue"); if (sendwServer != null) { sendwServer.sendMessage(jsonObject.toString()); } + + + JSONObject jsonObject2 = new JSONObject(); + jsonObject2.append("params", new short[] { 0, 3, 2, 3, 4, 5 }); + WebSocketServer sendwServer2 = WebSocketServer.sessionMap.get("action"); + if (sendwServer2 != null) { + sendwServer2.sendMessage(jsonObject2.toString()); + } } } } -- Gitblit v1.8.0