diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index da33881c..73404d90 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -202,6 +202,11 @@ export default { }, }).then(({data}) => { this.tempMsgs = this.tempMsgs.filter(({id}) => id != tempId) + this.$store.dispatch("saveDialog", { + id: this.dialogId, + last_msg: data, + last_at: $A.formatDate("Y-m-d H:i:s") + }); this.$store.dispatch("saveDialogMsg", data); }).catch(({msg}) => { $A.modalError(msg); diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index c0b7168f..7f6ccf2b 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -1277,7 +1277,11 @@ export default { // 更新最后消息 let dialog = state.dialogs.find(({id}) => id == dialog_id); if (dialog) { - dialog.last_msg = data; + dispatch("saveDialog", { + id: dialog_id, + last_msg: data, + last_at: state.method.formatDate("Y-m-d H:i:s") + }); } else { dispatch("getDialogOne", dialog_id); }