mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 05:59:00 +08:00
feat: 期刊路由优化,增加 scihub 模式 (#4094)
This commit is contained in:
@@ -186,7 +186,7 @@ module.exports = async (ctx, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
// fulltest
|
||||
// fulltext
|
||||
if (ctx.query.mode && ctx.query.mode.toLowerCase() === 'fulltext') {
|
||||
const tasks = ctx.state.data.item.map(async (item) => {
|
||||
const { link, author, description } = item;
|
||||
@@ -209,6 +209,14 @@ module.exports = async (ctx, next) => {
|
||||
});
|
||||
await Promise.all(tasks);
|
||||
}
|
||||
|
||||
// scihub
|
||||
if (ctx.query.scihub) {
|
||||
ctx.state.data.item.map((item) => {
|
||||
item.link = item.doi ? `https://sci-hub.tw/${item.doi}` : `https://sci-hub.tw/${item.link}`;
|
||||
return item;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user