const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const name = ctx.params.name; const url = `https://www.macbed.com/${name}/`; const res = await got.get(url); const $ = cheerio.load(res.data); const items = [ { title: $('h1.post-title').text(), description: `简介<\\strong>
${$('div.entry').text()}

Download Link `, link: url, }, ]; ctx.state.data = { title: name, link: url, item: items, }; };