fix: 修复漫画DB的ctx.state.data内link不正确 (#2112)

This commit is contained in:
junfengP
2019-05-12 22:18:13 +08:00
committed by DIYgod
parent c019b6f34f
commit 89927564d5
+3 -2
View File
@@ -4,9 +4,10 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => {
const id = ctx.params.id;
const comicPage = host + `/manhua/${id}`;
const response = await axios({
method: 'get',
url: host + `/manhua/${id}`,
url: comicPage,
});
const data = response.data;
const $ = cheerio.load(data);
@@ -14,7 +15,7 @@ module.exports = async (ctx) => {
const comicTitle = $('.comic-title').text();
ctx.state.data = {
title: '漫画DB - ' + comicTitle,
link: host,
link: comicPage,
description: '漫画DB',
item: list
.map((i, item) => ({