1
This commit is contained in:
@@ -56,14 +56,12 @@ const NewFollow = () => {
|
||||
|
||||
setFollowList(mappedList);
|
||||
|
||||
// 获取未读关注ID并标记已读
|
||||
const unreadFanIds = res.list
|
||||
.filter((item: any) => item.is_read === 0)
|
||||
.map((item: any) => item.id);
|
||||
// 获取所有关注者ID列表并标记已读(传入所有ID,包括已读和未读)
|
||||
const allFanIds = res.list.map((item: any) => item.id);
|
||||
|
||||
if (unreadFanIds.length > 0) {
|
||||
// 使用统一接口标记已读
|
||||
messageService.markAsRead('follow', unreadFanIds).catch(e => {
|
||||
if (allFanIds.length > 0) {
|
||||
// 使用统一接口标记已读,传入所有关注者ID
|
||||
messageService.markAsRead('follow', allFanIds).catch(e => {
|
||||
console.error("标记关注已读失败:", e);
|
||||
});
|
||||
}
|
||||
@@ -164,6 +162,15 @@ const NewFollow = () => {
|
||||
}));
|
||||
|
||||
setFollowList(mappedList);
|
||||
|
||||
// 获取所有关注者ID列表并标记已读(传入所有ID)
|
||||
const allFanIds = res.list.map((item: any) => item.id);
|
||||
|
||||
if (allFanIds.length > 0) {
|
||||
messageService.markAsRead('follow', allFanIds).catch(e => {
|
||||
console.error("标记关注已读失败:", e);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 如果没有数据,设置为空数组以显示空状态
|
||||
setFollowList([]);
|
||||
|
||||
Reference in New Issue
Block a user