fix(route): アークナイツ(明日方舟日服) (#8436)

This commit is contained in:
楚观 2021-11-27 16:42:11 +08:00 committed by GitHub
parent 5b186041ce
commit b9bb7555d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 0 deletions

View File

@ -539,6 +539,10 @@ Example`https://www.iyingdi.com/tz/people/55547` id 是 `55547`
<Route author="Astrian" example="/arknights/news" path="/arknights/news"/>
### アークナイツ(日服新闻)
<Route author="ofyark" example="/arknights/japan" path="/arknights/japan"/>
### 塞壬唱片
<Route author="rikkablue" example="/siren/news" path="/siren/news"/>

View File

@ -1986,6 +1986,8 @@ router.get('/tencent/pvp/newsindex/:type', lazyloadRouteHandler('./routes/tencen
// 《明日方舟》游戏
router.get('/arknights/news', lazyloadRouteHandler('./routes/arknights/news'));
// アークナイツ(明日方舟日服)
router.get('/arknights/japan', lazyloadRouteHandler('./routes/arknights/japan'));
// 塞壬唱片
router.get('/siren/news', lazyloadRouteHandler('./routes/siren/index'));

View File

@ -0,0 +1,26 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://www.arknights.jp:10014/news?lang=ja&limit=9&page=1',
});
const items = response.data.data.items;
const newsList = items.map((item) => ({
title: item.title,
description: item.content[0].value,
pubDate: item.publishedAt,
link: `https://www.arknights.jp/news/${item.id}`
}));
ctx.state.data = {
title: 'アークナイツ',
link: 'https://www.arknights.jp/news',
description: 'アークナイツ ニュース',
language: 'ja',
item: newsList,
};
};