fix(route): nogizaka46/news guid is not unique (#9137)
This commit is contained in:
parent
0af66b1a7d
commit
8d4ed52bde
|
|
@ -1,12 +1,14 @@
|
|||
const got = require('@/utils/got');
|
||||
const { parseDate } = require('@/utils/parse-date');
|
||||
|
||||
const rootUrl = 'https://www.nogizaka46.com';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 25;
|
||||
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: 'https://www.nogizaka46.com/s/n46/api/list/news',
|
||||
url: `${rootUrl}/s/n46/api/list/news`,
|
||||
headers: {
|
||||
Referer: 'http://www.nogizaka46.com/',
|
||||
},
|
||||
|
|
@ -19,6 +21,7 @@ module.exports = async (ctx) => {
|
|||
description: item.text,
|
||||
pubDate: parseDate(item.date),
|
||||
category: item.cate,
|
||||
guid: rootUrl + new URL(item.link_url).pathname,
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue