mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 20:27:52 +08:00
28 lines
845 B
JavaScript
28 lines
845 B
JavaScript
const axios = require('@/utils/axios');
|
|
|
|
module.exports = async (ctx) => {
|
|
const response = await axios({
|
|
method: 'get',
|
|
url: 'https://xiaoce-timeline-api-ms.juejin.im/v1/getListByLastTime?uid=&client_id=&token=&src=web&alias=&pageNum=1',
|
|
});
|
|
|
|
const data = response.data.d;
|
|
|
|
ctx.state.data = {
|
|
title: '掘金小册',
|
|
link: 'https://juejin.im/books',
|
|
item: data.map(({ title, id, img, desc, createdAt, price }) => ({
|
|
title,
|
|
link: `https://juejin.im/book/${id}`,
|
|
description: `
|
|
<img referrerpolicy="no-referrer" src="${img}"><br>
|
|
<strong>${title}</strong><br><br>
|
|
${desc}<br>
|
|
<strong>价格:</strong> ${price}元
|
|
`,
|
|
pubDate: new Date(createdAt).toUTCString(),
|
|
guid: id,
|
|
})),
|
|
};
|
|
};
|