fix: fix sse disclosure (#14001)

* add pdf_host

* camelCase
This commit is contained in:
Harvey Qiu 2023-12-10 22:27:37 +08:00 committed by GitHub
parent 8b10f38ea0
commit 7d96b038b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,6 @@ const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const query = ctx.params.query ?? ''; // beginDate=2018-08-18&endDate=2020-09-01&productId=600696
const host = 'https://www.sse.com.cn';
const queries = query.split('&').reduce((acc, cur) => {
const [key, value] = cur.split('=');
acc[key] = value;
@ -30,11 +29,13 @@ module.exports = async (ctx) => {
},
});
const pdfHost = 'https://static.sse.com.cn';
const items = response.data.result.map((item) => ({
title: item.TITLE,
description: `${host}${item.URL}`,
description: `${pdfHost}${item.URL}`,
pubDate: parseDate(item.ADDDATE),
link: `${host}${item.URL}`,
link: `${pdfHost}${item.URL}`,
author: item.SECURITY_NAME,
}));