diff --git a/lib/routes/tencent/wechat/wasi.js b/lib/routes/tencent/wechat/wasi.js index 42a30c930..0e9124520 100644 --- a/lib/routes/tencent/wechat/wasi.js +++ b/lib/routes/tencent/wechat/wasi.js @@ -2,11 +2,12 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const id = ctx.params.id; + const { id } = ctx.params; + const url = `https://wx.qnmlgb.tech/authors/${id}`; const response = await got({ method: 'get', - url: `https://wx.qnmlgb.tech/authors/${id}`, + url, }); const $ = cheerio.load(response.data); @@ -16,7 +17,7 @@ module.exports = async (ctx) => { title: `${$('#spider > div:nth-child(1) > div:nth-child(1)') .text() .trim()}微信公众号`, - link: `https://w.qnmlgb.tech/authors/${id}/`, + link: url, description: $('#spider > div:nth-child(2)') .text() .trim(), @@ -25,11 +26,14 @@ module.exports = async (ctx) => { list .map((i, ele) => { const $ = cheerio.load(ele); + const link = $('a').attr('href'); + return { title: $('.pretty') .text() .trim(), - link: $('a').attr('href'), + link: `https://wx.qnmlgb.tech${link}`, + guid: link, }; }) .get(),