diff --git a/src/chat.js b/src/chat.js index 0aaf93d..6ac6e4a 100644 --- a/src/chat.js +++ b/src/chat.js @@ -215,7 +215,7 @@ export default class Chat { await set(data.id, data, this.store) } 发送消息(text) { - const name = '我' + const name = localStorage.getItem('username') const id = window.crypto.randomUUID() const time = new Date().toLocaleString() const type = 'text' diff --git a/src/main.js b/src/main.js index 12c7d38..3631f5c 100644 --- a/src/main.js +++ b/src/main.js @@ -174,7 +174,7 @@ clientList.setChannel('chat', { return } if (data.type === 'list') { - console.log(client.name, `同步来 ${data.list.length} 条消息`) + console.log(client.name, `同步来 ${data.list.length} 条消息`, data.list) await chat.合并消息列表(data.list) return }