Skip to content

Commit 271e2d8

Browse files
committed
fix(system/message): 修复全部已读无效
1 parent 93bd70d commit 271e2d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

continew-system/src/main/java/top/continew/admin/system/service/impl/MessageServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public void readMessage(List<Long> ids, Long userId) {
7676
// 查询当前用户的未读消息
7777
List<MessageDO> list = baseMapper.selectUnreadListByUserId(userId);
7878
List<Long> unreadIds = list.stream().map(MessageDO::getId).toList();
79-
messageLogService.addWithUserId(CollUtil.intersection(unreadIds, ids).stream().toList(), userId);
79+
messageLogService.addWithUserId(CollUtil.isNotEmpty(ids)
80+
? CollUtil.intersection(unreadIds, ids).stream().toList()
81+
: unreadIds, userId);
8082
WebSocketUtils.sendMessage(StpUtil.getTokenValueByLoginId(userId), String.valueOf(baseMapper
8183
.selectUnreadListByUserId(userId)
8284
.size()));

0 commit comments

Comments
 (0)