fix(route): 艾瑞周度市场观察 (#14400)

This commit is contained in:
Ethan Shen 2024-02-06 00:30:17 +08:00 committed by GitHub
parent 87239ac8c8
commit b9771bd52c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ module.exports = async (ctx) => {
const category = ctx.params.category ?? '';
const rootUrl = 'https://www.iresearch.com.cn';
const currentUrl = `${rootUrl}/report.shtml?type=4`;
const currentUrl = `${rootUrl}/report?type=3`;
const apiUrl = `${rootUrl}/api/json/report/ireport.json`;
const response = await got({
@ -16,8 +16,8 @@ module.exports = async (ctx) => {
});
const items = JSON.parse(response.data.slice(1))
.slice(0, ctx.query.limit ? Number.parseInt(ctx.query.limit) : 200)
.filter((item) => (category ? item.classname === category : true))
.slice(0, ctx.query.limit ? Number.parseInt(ctx.query.limit) : 200)
.map((item) => ({
title: item.reportname,
pubDate: parseDate(item.addtime),