mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化代码
This commit is contained in:
parent
874c631229
commit
d77f00f50d
@ -228,7 +228,7 @@
|
|||||||
if (_pingTime - self.pingTime < 15 * 1000) {
|
if (_pingTime - self.pingTime < 15 * 1000) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
websocket.send("{'cmd':'ping','clientId':'" + clientId + "'}");
|
websocket.send("{'cmd':'ping'}");
|
||||||
self.pingTime = _pingTime;
|
self.pingTime = _pingTime;
|
||||||
|
|
||||||
heartCheck.reset().start(); // 如果获取到消息,说明连接是正常的,重置心跳检测
|
heartCheck.reset().start(); // 如果获取到消息,说明连接是正常的,重置心跳检测
|
||||||
@ -248,11 +248,11 @@
|
|||||||
if (_protocol.startsWith('https')) {
|
if (_protocol.startsWith('https')) {
|
||||||
url =
|
url =
|
||||||
"wss://" + window.location.host + "/ws/message/" +
|
"wss://" + window.location.host + "/ws/message/" +
|
||||||
_userId;
|
_userId + "/" + clientId;
|
||||||
} else {
|
} else {
|
||||||
url =
|
url =
|
||||||
"ws://" + window.location.host + "/ws/message/" +
|
"ws://" + window.location.host + "/ws/message/" +
|
||||||
_userId;
|
_userId + "/" + clientId;
|
||||||
// url =
|
// url =
|
||||||
// "ws://demo.homecommunity.cn/ws/message/" +
|
// "ws://demo.homecommunity.cn/ws/message/" +
|
||||||
// _userId;
|
// _userId;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user