From 24345ef6c6de1459af3d243b4da8e69aa6f4ed64 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 23 Jun 2021 00:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E9=98=85=E8=AF=BB=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/pages/manage/components/DialogWrapper.vue | 5 +++++ resources/assets/js/store/actions.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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); }