소스 검색

站内消息可以撤回

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) {