diff --git a/backend/app/services/news_service.py b/backend/app/services/news_service.py index 6dca097..af68041 100755 --- a/backend/app/services/news_service.py +++ b/backend/app/services/news_service.py @@ -410,7 +410,10 @@ class NewsPlatformService: return p def _filter(items): - """过滤本人发布 + 无效 ID""" + """过滤本人发布 + 无效ID + 无标题/无recordId的空条目""" + # 过滤空条目(recordId/title 为 null,type!=1 等异常数据) + items = [x for x in items + if x.get("recordId") and x.get("title") and x.get("type") == "1"] if platform_uid: items = [x for x in items if x.get("createUser") != platform_uid] items = [x for x in items