chore: format

This commit is contained in:
DIYgod
2021-11-27 09:03:43 +00:00
parent 3c432eb7e0
commit b791066704
5 changed files with 27 additions and 29 deletions
+2 -4
View File
@@ -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,
};
};
};
+2 -2
View File
@@ -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}`,
}));