feat: add lkong digest (#3132)

This commit is contained in:
hoilc
2019-09-25 12:03:03 +08:00
committed by DIYgod
parent aeca3bd1cf
commit 991d9ff551
3 changed files with 7 additions and 5 deletions

View File

@@ -2,6 +2,8 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const id = ctx.params.id;
const type_path = ctx.params.digest ? '/digest' : '';
const type_name = ctx.params.digest ? ' 精华' : '';
const response = await got({
method: 'get',
@@ -11,7 +13,7 @@ module.exports = async (ctx) => {
const response_forum_item = await got({
method: 'get',
url: `http://lkong.cn/forum/index.php?mod=data&sars=forum/${id}`,
url: `http://lkong.cn/forum/index.php?mod=data&sars=forum/${id}${type_path}`,
});
const data = response_forum_item.data;
@@ -64,8 +66,8 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: `龙空 ${forumconfig.name}`,
link: `http://lkong.cn/forum/${id}`,
title: `龙空 ${forumconfig.name}${type_name}`,
link: `http://lkong.cn/forum/${id}${type_path}`,
description: forumconfig.blackboard,
image: `http://img.lkong.cn/forumavatar/000/00/00/${id}_avatar_middle.jpg`,
item: items,