Files
RSSHub/lib/v2/cde/utils.js
Tony cdd1d2fea5 feat(route): cde xxgk (#10094)
* feat(route): cde xxgk

* docs: fix example

* docs: fix path
2022-07-02 01:21:46 +08:00

21 lines
469 B
JavaScript

const got = require('@/utils/got');
const title = '国家药品监督管理局药品审评中心';
const rootUrl = 'https://www.cde.org.cn';
const getCookie = (ctx) =>
ctx.cache.tryGet('cde:cookie', async () => {
const response = await got(rootUrl);
return response.headers['set-cookie']
.join()
.match(/FSSBBIl1UgzbN7N80.*?;/g)
.join('');
});
module.exports = {
title,
rootUrl,
getCookie,
};