Browse Source

修复删除消息的bug

master
xsx 11 months ago
parent
commit
82f5234c94
  1. 12
      im-web/src/components/chat/ChatBox.vue
  2. 2
      im-web/src/view/Group.vue

12
im-web/src/components/chat/ChatBox.vue

@ -480,7 +480,7 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.commit("deleteMessage", msgInfo);
this.$store.commit("deleteMessage", [msgInfo, this.chat]);
});
},
recallMessage(msgInfo) {
@ -567,13 +567,15 @@ export default {
})
},
showName(msgInfo) {
if (this.chat.type == 'GROUP') {
if (!msgInfo) {
return ""
}
if (this.isGroup) {
let member = this.groupMembers.find((m) => m.userId == msgInfo.sendId);
return member ? member.showNickName : "";
return member ? member.showNickName : msgInfo.sendNickName || "";
} else {
return msgInfo.sendId == this.mine.id ? this.mine.nickName : this.chat.showName
return msgInfo.selfSend ? this.mine.nickName : this.chat.showName
}
},
headImage(msgInfo) {
if (this.chat.type == 'GROUP') {

2
im-web/src/view/Group.vue

@ -61,7 +61,7 @@
maxlength="1024" placeholder="群主未设置"></el-input>
</el-form-item>
<div>
<el-button type="warning" v-show="isOwner" @click="onInviteMember()">邀请</el-button>
<el-button type="warning" @click="onInviteMember()">邀请</el-button>
<el-button type="success" @click="onSaveGroup()">保存</el-button>
<el-button type="danger" v-show="!isOwner" @click="onQuit()">退出</el-button>
<el-button type="danger" v-show="isOwner" @click="onDissolve()">解散</el-button>

Loading…
Cancel
Save