mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
fix(route): 光谷社区重复帖子 (#7110)
This commit is contained in:
+4
-4
@@ -248,11 +248,11 @@ pageClass: routes
|
||||
|
||||
### 子论坛
|
||||
|
||||
<Route author="nczitzk" example="/guanggoo/index" path="/guanggoo/:caty" :paramsDesc="['子论坛']">
|
||||
<Route author="nczitzk" example="/guanggoo/index" path="/guanggoo/:category?" :paramsDesc="['子论坛,默认为首页']">
|
||||
|
||||
| 首页 | 你问我答 | 同城活动 | IT 技术 | 金融财经 | 创业创客 | 城市建设 |
|
||||
| ----- | -------- | -------- | ------- | -------- | -------- | -------- |
|
||||
| index | qna | lowshine | it | finance | startup | city |
|
||||
| 首页 | 你问我答 | 同城活动 | IT 技术 | 金融财经 | 创业创客 | 城市建设 |
|
||||
| ---- | -------- | -------- | ------- | -------- | -------- | -------- |
|
||||
| | qna | lowshine | it | finance | startup | city |
|
||||
|
||||
</Route>
|
||||
|
||||
|
||||
+1
-1
@@ -3145,7 +3145,7 @@ router.get('/gelonghui/subject/:id', require('./routes/gelonghui/subject'));
|
||||
router.get('/gelonghui/keyword/:keyword', require('./routes/gelonghui/keyword'));
|
||||
|
||||
// 光谷社区
|
||||
router.get('/guanggoo/:caty', require('./routes/guanggoo/index'));
|
||||
router.get('/guanggoo/:category?', require('./routes/guanggoo/index'));
|
||||
|
||||
// 万维读者
|
||||
router.get('/creaders/headline', require('./routes/creaders/headline'));
|
||||
|
||||
@@ -36,7 +36,9 @@ const config = {
|
||||
};
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const cfg = config[ctx.params.caty];
|
||||
const category = ctx.params.category || 'index';
|
||||
|
||||
const cfg = config[category];
|
||||
if (!cfg) {
|
||||
throw Error('Bad category. See <a href="https://docs.rsshub.app/bbs.html#guang-gu-she-qu-zi-lun-tan">docs</a>');
|
||||
}
|
||||
@@ -54,7 +56,7 @@ module.exports = async (ctx) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.text(),
|
||||
link: url.resolve(rootUrl, item.attr('href')),
|
||||
link: url.resolve(rootUrl, item.attr('href').split('#')[0]),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
Reference in New Issue
Block a user