mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 13:39:35 +08:00
optimize directory structure
This commit is contained in:
35
lib/routes/jike/topic.js
Normal file
35
lib/routes/jike/topic.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const common = require('./common');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
|
||||
const response = await axios({
|
||||
method: 'post',
|
||||
url: 'https://app.jike.ruguoapp.com/1.0/messages/history',
|
||||
headers: {
|
||||
Referer: `https://m.okjike.com/topics/${id}`,
|
||||
'App-Version': '4.1.0',
|
||||
},
|
||||
data: {
|
||||
loadMoreKey: null,
|
||||
topic: id,
|
||||
limit: 10,
|
||||
},
|
||||
});
|
||||
|
||||
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}/official`,
|
||||
description: topic.content,
|
||||
image: topic.squarePicture.picUrl || topic.squarePicture.middlePicUrl || topic.squarePicture.thumbnailUrl,
|
||||
item: common.topicDataHanding(data),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user