diff --git a/public/wsconfig.json b/public/wsconfig.json index 2484c26..ef8610f 100644 --- a/public/wsconfig.json +++ b/public/wsconfig.json @@ -1,3 +1,3 @@ { - "url": "172.16.32.40:48080" + "url": "192.168.8.22" } \ No newline at end of file diff --git a/src/store/UpdateData.tsx b/src/store/UpdateData.tsx index 4b1a019..93fb412 100644 --- a/src/store/UpdateData.tsx +++ b/src/store/UpdateData.tsx @@ -35,16 +35,16 @@ function UpdateData() { const dispatch = useAppDispatch(); if ('WebSocket' in window) { websocketAllLine = new WebSocket("ws://" + myUrl + "/websocket/message?userId=all"); - websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1"); - websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2"); - websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1"); - websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2"); - websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1"); - websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2"); - websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1"); - websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2"); - websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1"); - websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2"); + websocket1_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-1-" + Date.now()); + websocket1_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=1-2-" + Date.now()); + websocket2_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-1-" + Date.now()); + websocket2_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=2-2-" + Date.now()); + websocket3_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-1-" + Date.now()); + websocket3_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=3-2-" + Date.now()); + websocket4_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-1-" + Date.now()); + websocket4_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=4-2-" + Date.now()); + websocket5_1 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-1-" + Date.now()); + websocket5_2 = new WebSocket("ws://" + myUrl + "/websocket/message?userId=5-2-" + Date.now()); //连接成功建立的回调方法 } else { alert('Not support websocket');