pp
This commit is contained in:
@@ -100,9 +100,14 @@
|
||||
},
|
||||
// 获得一次日志
|
||||
fetch_log: function () {
|
||||
const me = this
|
||||
Jm.util.ajax.get(`${this.coop_api_url}?coop_mind_id=${this.coop_mind_id}&cooperation_mind_log_id=${this.coop_mind_log_id}`, function (resp) {
|
||||
console.log(resp)
|
||||
// _handle_msg_inner
|
||||
//
|
||||
const resp_data_array = resp.data
|
||||
console.log(resp_data_array)
|
||||
resp_data_array.forEach(item => {
|
||||
me._handle_msg_inner(item)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 清理定时任务
|
||||
@@ -135,8 +140,14 @@
|
||||
},
|
||||
// 处理消息广告方法
|
||||
_handle_msg_inner(msg_json) {
|
||||
|
||||
// 校验 client_id
|
||||
const client_id = msg_json.client_id
|
||||
const log_id = msg_json.log_id
|
||||
if (!client_id) {
|
||||
return
|
||||
}
|
||||
const log_content = JSON.parse(msg_json.log_content)
|
||||
const log_id = msg_json.id
|
||||
if (log_id > this.coop_mind_log_id) {
|
||||
this.coop_mind_log_last_id = this.coop_mind_log_id
|
||||
this.coop_mind_log_id = log_id
|
||||
@@ -146,8 +157,8 @@
|
||||
if (client_id === this.client_id) {
|
||||
console.log('self msg')
|
||||
} else {
|
||||
const evt = msg_json.evt
|
||||
const data_array = msg_json.data
|
||||
const evt = log_content.evt
|
||||
const data_array = log_content.data
|
||||
// console.log(msg_json)
|
||||
if ('add_node' === evt) {
|
||||
this._jm.add_node(data_array[0], data_array[1], data_array[2], null, true)
|
||||
|
||||
Reference in New Issue
Block a user