fix(route): 艾瑞周度市场观察 (#14400)
This commit is contained in:
parent
87239ac8c8
commit
b9771bd52c
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue