This commit is contained in:
aqu415
2022-02-16 22:10:08 +08:00
parent 01539916d6
commit f5b42e6f5f
7 changed files with 56 additions and 43 deletions
+10 -4
View File
@@ -34,7 +34,7 @@
coop_mind_id: null,
// 上一次操作日志ID
coop_mind_log_last_id: 0,
// 默认操作日志ID
// 默认操作日志IDh
coop_mind_log_id: 0,
// 定时备份数据
timer_push_task: null,
@@ -76,7 +76,7 @@
}
ws.onmessage = function (e) {
//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
me._oper_jsmind_with_ws_message(e.data)
me._handle_jsmind_with_ws_message(e.data)
}
ws.onclose = function (e) {
//当客户端收到服务端发送的关闭连接请求时,触发onclose事件
@@ -117,8 +117,14 @@
return {'client_id': this.client_id, 'log_uuid': Jm.util.uuid.newid(), 'coop_mind_id': this.coop_mind_id}
},
// 调用jsmind接口
_oper_jsmind_with_ws_message: function (message) {
_handle_jsmind_with_ws_message: function (message) {
const msg_json = JSON.parse(message)
const client_id = msg_json.client_id
if (client_id === this.client_id) {
console.log('self msg')
} else {
}
},
/**
* body:
@@ -153,7 +159,7 @@
},
// 发送ws消息
_send_ws_message: function (msg) {
if (this.web_socket) {
if (this.web_socket != null) {
this.web_socket.send(msg)
} else {
console.error('web_socket is not ready!')