arraybuffer to buffer

This commit is contained in:
DIYgod
2019-04-18 00:09:44 +08:00
parent 632459d647
commit de32ba0ffe
8 changed files with 9 additions and 9 deletions

View File

@@ -36,7 +36,7 @@ module.exports = async (ctx) => {
headers: {
Referer: pcUrl,
},
responseType: 'arraybuffer',
responseType: 'buffer',
});
const $ = cheerio.load(iconv.decode(storyDetail.data, 'gb2312'));
$('#articleContent img').each(function(_, item) {

View File

@@ -36,7 +36,7 @@ module.exports = async (ctx) => {
}
const response = await axios.get(itemUrl, {
responseType: 'arraybuffer',
responseType: 'buffer',
});
response.data = iconv.decode(response.data, 'gbk');