const got = require('@/utils/got'); module.exports = async (ctx) => { const keyword = ctx.params.keyword; const url = `https://www.dgtle.com/search?search_word=${encodeURIComponent(keyword)}`; const response = await got({ method: 'get', url: `https://www.dgtle.com/search/sale?search_word=${encodeURIComponent(keyword)}&page=1`, headers: { Referer: url, }, }); const list = response.data.data.dataList; ctx.state.data = { title: `数字尾巴 - 闲置 - ${keyword}`, link: url, item: list.map((item) => ({ title: item.title.replace(/<.*?>/g, ''), author: item.author.username, description: `
价格: ¥${item.price}
地址: ${item.address}
${item.content}