From 383fb9f02fc3a1a2eafbfa377436f5a2e8ffe427 Mon Sep 17 00:00:00 2001 From: Andvari <31068367+dzx-dzx@users.noreply.github.com> Date: Tue, 3 Oct 2023 06:18:31 +0800 Subject: [PATCH] fix(route): prevent `null` category in udn feed. (#13452) --- lib/v2/udn/breaking-news.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/v2/udn/breaking-news.js b/lib/v2/udn/breaking-news.js index 2f989fd54..61670f525 100644 --- a/lib/v2/udn/breaking-news.js +++ b/lib/v2/udn/breaking-news.js @@ -55,7 +55,7 @@ module.exports = async (ctx) => { author: data.author.name, description, pubDate: timezone(parseDate(item.time.date, 'YYYY-MM-DD HH:mm'), +8), - category: [data.articleSection, $("meta[name='subsection']").attr('content'), ...data.keywords.split(',')], + category: [data.articleSection, !vip ? $("meta[name='subsection']").attr('content') : $('.article-head li.breadcrumb__item:last > b').text(), ...data.keywords.split(',')], link, }; });