mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): wallstreetcn/live some data have not author property (#9073)
This commit is contained in:
@@ -24,13 +24,22 @@ module.exports = async (ctx) => {
|
||||
url: apiUrl,
|
||||
});
|
||||
|
||||
const items = response.data.data.items.map((item) => ({
|
||||
link: item.uri,
|
||||
title: item.title || item.content_text,
|
||||
description: item.content,
|
||||
pubDate: parseDate(item.display_time * 1000),
|
||||
author: item.author.display_name,
|
||||
}));
|
||||
const items = response.data.data.items.map((item) => {
|
||||
let author;
|
||||
try {
|
||||
author = item.author.display_name;
|
||||
} catch (e) {
|
||||
author = '';
|
||||
}
|
||||
|
||||
return {
|
||||
link: item.uri,
|
||||
title: item.title || item.content_text,
|
||||
description: item.content,
|
||||
pubDate: parseDate(item.display_time * 1000),
|
||||
author,
|
||||
};
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${titles[category]} - 实时快讯 - 华尔街见闻`,
|
||||
|
||||
Reference in New Issue
Block a user