diff --git a/server/models.py b/server/models.py index 2021ac7..320361f 100644 --- a/server/models.py +++ b/server/models.py @@ -19,7 +19,7 @@ class CooperationMind(AbstractModel): creator = models.BigIntegerField(verbose_name='创建人ID', null=False, blank=False) client_id = models.CharField(verbose_name='客户端ID', max_length=64, null=False, blank=False) snapshot_data = models.TextField(verbose_name='脑图数据', null=True, ) - snapshot_log_id = models.BigIntegerField(verbose_name='data对应的操作日志(cooperation_mind_log)ID', null=True, ) + log_id = models.BigIntegerField(verbose_name='data对应的操作日志(cooperation_mind_log)ID', null=True, ) class Meta: db_table = 'cooperation_mind' diff --git a/static/html/detail.html b/static/html/detail.html index 33ca53a..a9484e7 100644 --- a/static/html/detail.html +++ b/static/html/detail.html @@ -45,7 +45,7 @@ // show let data = resp.data.snapshot_data me.coop_mind_id = id - me.coop_mind_log_id = resp.data.snapshot_log_id + me.coop_mind_log_id = resp.data.log_id me.show_mind(resp.data.coop_mind_name, JSON.parse(data)) }) }, diff --git a/static/js/jsmind.coop.js b/static/js/jsmind.coop.js index 107e156..4c8d612 100644 --- a/static/js/jsmind.coop.js +++ b/static/js/jsmind.coop.js @@ -65,8 +65,6 @@ this.coop_mind_id = _jm.options.coop_mind_id this.coop_mind_log_id = _jm.options.coop_mind_log_id this.coop_mind_log_last_id = _jm.options.coop_mind_log_id - - console.log(this.coop_mind_log_id) }, // 初始化websocket _init_ws: function () { @@ -131,6 +129,12 @@ _handle_jsmind_with_ws_message: function (message) { const msg_json = JSON.parse(message) const client_id = msg_json.client_id + const log_id = msg_json.log_id + if (log_id > this.coop_mind_log_id) { + this.coop_mind_log_id = log_id + } + + // 回放 if (client_id === this.client_id) { console.log('self msg') } else {