浏览代码

站内消息可以撤回

Michael Wang 4 年之前
父节点
当前提交
0c136ee38c
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      src/store.js

+ 9 - 0
src/store.js

@@ -224,6 +224,15 @@ export default new Vuex.Store({
       console.log("与服务器时间差异:" + payload);
     },
     updateSiteMessages(state, payload) {
+      if (Array.isArray(payload)) {
+        payload = payload.map((notice) => {
+          if (notice.hasRecalled) {
+            notice.title = "发送者已撤回消息:" + notice.title;
+            notice.content = "该消息已经被发送者撤回。";
+          }
+          return notice;
+        });
+      }
       state = Object.assign(state, { siteMessages: payload });
     },
     updateSiteMessagesTimeStamp(state, payload) {