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,11 +1,11 @@
const axios = require('@/utils/axios');
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const id = ctx.params.id;
const link = `http://www.woshipm.com/u/${id}`;
const response = await axios.get(link);
const response = await got.get(link);
const $ = cheerio.load(response.data);
const name = $('div.name').text();
@@ -38,7 +38,7 @@ module.exports = async (ctx) => {
return Promise.resolve(JSON.parse(cache));
}
const response = await axios.get(itemUrl);
const response = await got.get(itemUrl);
const $ = cheerio.load(response.data);
const description = $('div.grap')
.html()