diff --git a/lib/routes/pnas/index.js b/lib/routes/pnas/index.js index cddb3ae78..6feb7602a 100644 --- a/lib/routes/pnas/index.js +++ b/lib/routes/pnas/index.js @@ -4,13 +4,13 @@ const got = require('@/utils/got'); module.exports = async (ctx) => { const baseUrl = `https://www.pnas.org`; - const tid = ctx.params.tid; + const topic = ctx.params.topic; let url = `${baseUrl}/content/early/recent`; - if (tid !== 'latest') { - url = `${baseUrl}/content/by/section/${ctx.params.tid}`; + if (topic && topic !== 'latest') { + url = `${baseUrl}/content/by/section/${ctx.params.topic}`; } else { - ctx.params.tid = 'Latest Research'; + ctx.params.topic = 'Latest Research'; } const res = await got.get(url); @@ -59,7 +59,7 @@ module.exports = async (ctx) => { }) ); ctx.state.data = { - title: `PNAS | ${ctx.params.tid}`, + title: `PNAS | ${ctx.params.topic}`, link: url, item: out, };