chore: format
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
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',
|
||||
@@ -12,7 +11,7 @@ module.exports = async (ctx) => {
|
||||
title: item.title,
|
||||
description: item.content[0].value,
|
||||
pubDate: item.publishedAt,
|
||||
link: `https://www.arknights.jp/news/${item.id}`
|
||||
link: `https://www.arknights.jp/news/${item.id}`,
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
@@ -22,5 +21,4 @@ module.exports = async (ctx) => {
|
||||
language: 'ja',
|
||||
item: newsList,
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = async (ctx) => {
|
||||
const api = 'https://www.secrss.com/api/articles?tag=';
|
||||
let type = ctx.params.category;
|
||||
if (type === undefined) {
|
||||
type = "";
|
||||
type = '';
|
||||
}
|
||||
const host = 'https://www.secrss.com';
|
||||
const res = await got.get(`${api}${type}`);
|
||||
@@ -13,7 +13,7 @@ module.exports = async (ctx) => {
|
||||
const items = dataArray.map((item) => ({
|
||||
title: item.title,
|
||||
description: item.summary,
|
||||
pubDate: new Date(item.published_at + " GMT").toUTCString(),
|
||||
pubDate: new Date(item.published_at + ' GMT').toUTCString(),
|
||||
link: `${host}/articles/${item.id}`,
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user