Browse Source

将消息设为已读

chrislee 1 week ago
parent
commit
9397fbeaa1
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/utils/msg.js

+ 7 - 0
src/utils/msg.js

@@ -49,6 +49,13 @@ export function routeMsgs (that, row) {
     return
   }
 
+  // 先将消息标记为已读(若当前 store 中不存在该消息则内部会直接返回)
+  if (row.noticeId) {
+    try {
+      readNotice && readNotice(that, row.noticeId)
+    } catch (e) {}
+  }
+
   // 携带的消息参数(列表页可通过 $route.params.notice 或 $route.query 获取)
   const notice = {
     noticeId: row.noticeId,