refactor: rename axios to got

This commit is contained in:
DIYgod
2019-06-03 18:03:05 +08:00
parent c4bf4fcdb4
commit a56c0b5a39
629 changed files with 1552 additions and 1552 deletions

View File

@@ -1,5 +1,5 @@
const cheerio = require('cheerio');
const axios = require('@/utils/axios');
const got = require('@/utils/got');
// 分类标题
const categoryTitle = new Map([
@@ -33,7 +33,7 @@ module.exports = async (ctx) => {
link = link + `${subcate}`;
title = title + '/' + categoryTitle.get(category).type[subcate];
}
const res = await axios.get(link);
const res = await got.get(link);
const $ = cheerio.load(res.data);
// 文章列表
const list = $('.con_list li h3')
@@ -47,7 +47,7 @@ module.exports = async (ctx) => {
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const res = await axios.get(itemUrl);
const res = await got.get(itemUrl);
const $ = cheerio.load(res.data);
const item = {