mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 04:11:26 +08:00
38 lines
1007 B
JavaScript
38 lines
1007 B
JavaScript
const got = require('@/utils/got');
|
|
const common = require('./common');
|
|
|
|
module.exports = async (ctx) => {
|
|
const id = ctx.params.id;
|
|
|
|
const response = await got({
|
|
method: 'post',
|
|
url: 'https://app.jike.ruguoapp.com/1.0/squarePosts/list',
|
|
headers: {
|
|
Referer: `https://m.okjike.com/topics/${id}`,
|
|
'App-Version': '4.12.0',
|
|
},
|
|
json: true,
|
|
data: {
|
|
loadMoreKey: null,
|
|
topicId: id,
|
|
limit: 20,
|
|
},
|
|
});
|
|
|
|
const data = response.data.data;
|
|
|
|
if (common.emptyResponseCheck(ctx, data)) {
|
|
return;
|
|
}
|
|
|
|
const topic = data[0].topic;
|
|
|
|
ctx.state.data = {
|
|
title: `${topic.content} - 即刻主题广场`,
|
|
link: `https://web.okjike.com/topic/${id}/user`,
|
|
description: topic.content,
|
|
image: topic.squarePicture.picUrl || topic.squarePicture.middlePicUrl || topic.squarePicture.thumbnailUrl,
|
|
item: common.topicDataHanding(data),
|
|
};
|
|
};
|