fix(route): 书趣阁域名切换后访问失败 (#7734)
This commit is contained in:
parent
f85a40d4ad
commit
70da5d32ef
|
|
@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|||
const cheerio = require('cheerio');
|
||||
const iconv = require('iconv-lite');
|
||||
|
||||
const baseUrl = 'http://www.shuquge.com/txt/';
|
||||
const baseUrl = 'http://www.sizhicn.com/txt/';
|
||||
// 获取小说的最新章节列表
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id; // 小说id
|
||||
|
|
@ -10,7 +10,6 @@ module.exports = async (ctx) => {
|
|||
const response = await got({
|
||||
method: 'get',
|
||||
url: `${baseUrl}${id}/index.html`,
|
||||
// responseEncoding: 'gbk', //该配置项在 0.18版本中没有打包进去
|
||||
responseType: 'buffer',
|
||||
});
|
||||
const responseHtml = iconv.decode(response.data, 'utf-8');
|
||||
|
|
|
|||
Loading…
Reference in New Issue