fix(route/caixin): filter out articles that does not have ID (#17495)

This commit is contained in:
Andvari
2024-11-07 07:23:21 -08:00
committed by GitHub
parent 8ea3ee3760
commit c8f182dc4c
+4 -1
View File
@@ -12,6 +12,10 @@ export async function getFulltext(url: string) {
if (!config.caixin.cookie) {
return;
}
if (!/(\d+)\.html/.test(url)) {
return;
}
const articleID = url.match(/(\d+)\.html/)[1];
const nonce = crypto.randomUUID().replaceAll('-', '').toUpperCase();
@@ -20,7 +24,6 @@ export async function getFulltext(url: string) {
.find((e) => e.includes('SA_USER_UID'))
?.split('=')[1]; //
const articleID = url.match(/(\d+)\.html/)[1];
const rawString = `id=${articleID}&uid=${userID}&${nonce}=nonce`;
const sig = new KJUR.crypto.Signature({ alg: 'SHA256withRSA' });