标签
@@ -108,6 +104,7 @@
@@ -911,17 +908,22 @@ export default {
if (!value.trim()) return
this.createNewGroup(value.trim())
})
+ } else if (groupId === '' || groupId === null || groupId === undefined) {
+ // 清空分组
+ this.doSaveGroup('')
} else {
this.doSaveGroup(groupId)
}
},
doSaveGroup(groupId) {
+ // 如果 groupId 为空字符串,表示移除分组
+ const saveGroupId = groupId || '';
this.$http.post('/user/group/save', {
userId: this.userInfo.id,
- groupIds: String(groupId)
+ groupIds: String(saveGroupId)
}).then(() => {
- console.log('res',groupId)
- this.$message.success('分组设置成功')
+ console.log('res', saveGroupId)
+ this.$message.success(saveGroupId ? '分组设置成功' : '已移除分组')
this.loadFriend(this.chat.targetId)
})
},
@@ -1376,7 +1378,7 @@ export default {
word-break: break-all;
::v-deep .el-select {
.el-tag {
- background-color: #4d4949 !important;
+ background-color: #bdbaba !important;
color: #fff !important;
border-color: #1d1b1b !important;
.el-tag__close {
diff --git a/im-web/src/components/chat/ChatMessageItem.vue b/im-web/src/components/chat/ChatMessageItem.vue
index edb801c..7489fcd 100644
--- a/im-web/src/components/chat/ChatMessageItem.vue
+++ b/im-web/src/components/chat/ChatMessageItem.vue
@@ -54,8 +54,8 @@
{{ msgInfo.content }}
- 已读
- 未读
+ Read
+ Unread
diff --git a/im-web/src/store/chatStore.js b/im-web/src/store/chatStore.js
index f3658b1..91d0c75 100644
--- a/im-web/src/store/chatStore.js
+++ b/im-web/src/store/chatStore.js
@@ -30,7 +30,7 @@ export default defineStore('chatStore', {
chats: [],
privateMsgMaxId: 0,
groupMsgMaxId: 0,
- loading: false
+ loading: true
}
},
actions: {
@@ -95,7 +95,9 @@ export default defineStore('chatStore', {
readedMessage(pos) {
let chat = this.findChatByFriend(pos.friendId);
if (!chat) return;
- for (let idx = chat.readedMessageIdx; idx < chat.messages.length; idx++) {
+ // 已读回执没有做可靠性投递,通过回溯100条的方式去修正
+ let idx = Math.max(0, chat.readedMessageIdx - 100);
+ for (; idx < chat.messages.length; idx++) {
let m = chat.messages[idx];
if (m.id && m.selfSend && m.status < MESSAGE_STATUS.RECALL) {
// pos.maxId为空表示整个会话已读
@@ -449,7 +451,7 @@ export default defineStore('chatStore', {
this.activeChat = null;
this.privateMsgMaxId = 0;
this.groupMsgMaxId = 0;
- this.loading = false;
+ this.loading = true;
},
loadChat() {
return new Promise((resolve, reject) => {