fix(route): fix stats-cn (#11964)
This commit is contained in:
parent
4698900401
commit
efd2bf2332
|
|
@ -8,7 +8,7 @@ module.exports = async (ctx) => {
|
|||
pathname = pathname === '' ? defaultPath : pathname.endsWith('/') ? pathname : pathname + '/';
|
||||
const currentUrl = `${rootUrl}${pathname}`;
|
||||
|
||||
const { list, title } = await parseContList(currentUrl, 'ul.center_list_contlist li a:not([id])', ctx);
|
||||
const { list, title } = await parseContList(currentUrl, 'ul.center_list_contlist li a:not([id]), ul.center_list_cont li a:not([id])', ctx);
|
||||
const items = await Promise.all(list.map((item) => parseXilan(item, ctx)));
|
||||
|
||||
ctx.state.data = {
|
||||
|
|
|
|||
|
|
@ -13,10 +13,12 @@ const parseContList = async (url, selector, ctx) => {
|
|||
.toArray()
|
||||
.map((item) => {
|
||||
item = $(item);
|
||||
|
||||
const date = item.find('.cont_tit02').text() || item.next('.cont_tit02').text();
|
||||
return {
|
||||
title: item.find('.cont_tit03').text(),
|
||||
title: item.find('.cont_tit03, .cont_tit01').text(),
|
||||
link: new URL(item.attr('href'), url).href,
|
||||
pubDate: parseDate(item.find('.cont_tit02').text(), 'YYYY-MM-DD'),
|
||||
pubDate: parseDate(date, 'YYYY-MM-DD'),
|
||||
};
|
||||
})
|
||||
.filter((item) => item.title); // exclude the empty title
|
||||
|
|
|
|||
Loading…
Reference in New Issue