feat : 通讯录管理
This commit is contained in:
@@ -127,8 +127,11 @@ const initWebSocket = () => {
|
||||
}
|
||||
//接收到消息的回调方法
|
||||
socket.onmessage = function (event) {
|
||||
let data = JSON.parse(event.data)
|
||||
console.log("服务器返回的信息: ", JSON.parse(event.data));
|
||||
let data = JSON.parse(event.data)
|
||||
if(data.type!=='pong'){
|
||||
|
||||
console.log("服务器返回的信息: ", data);
|
||||
}
|
||||
}
|
||||
//连接关闭的回调方法
|
||||
socket.onclose = function () {
|
||||
@@ -137,7 +140,7 @@ const initWebSocket = () => {
|
||||
}
|
||||
setInterval(() => {
|
||||
socket.send(JSON.stringify(send))
|
||||
}, 3000)
|
||||
}, 30000)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
console.log("ws连接失败");
|
||||
|
||||
Reference in New Issue
Block a user