feat(route)!: remove kuaibao (#10708)
This commit is contained in:
@@ -2478,12 +2478,6 @@ column 为 third 时可选的 category:
|
||||
|
||||
<Route author="WenryXu" example="/juesheng" path="/juesheng"/>
|
||||
|
||||
## 看点快报
|
||||
|
||||
### 首页
|
||||
|
||||
<Route author="nczitzk" example="/kuaibao" path="/kuaibao/index"/>
|
||||
|
||||
## 科技島讀
|
||||
|
||||
### 分類
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const currentUrl = 'http://kuaibao.qq.com/n/getKbMainpageInfo';
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: currentUrl,
|
||||
});
|
||||
|
||||
const articleList = response.data.newslist.map((item) => ({
|
||||
title: item.title,
|
||||
link: `https://kuaibao.qq.com/getSubNewsContent?id=${item.id}&style=json`,
|
||||
pubDate: new Date(item.time).toUTCString(),
|
||||
}));
|
||||
|
||||
ctx.state.data = {
|
||||
title: '看点快报 - 首页',
|
||||
link: 'http://kuaibao.qq.com/',
|
||||
item: await Promise.all(
|
||||
articleList.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const contentResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link,
|
||||
});
|
||||
item.link = contentResponse.data.url || contentResponse.data.short_url;
|
||||
item.description = contentResponse.data.content.text;
|
||||
return item;
|
||||
})
|
||||
)
|
||||
),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user