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,4 +1,4 @@
const axios = require('@/utils/axios');
const got = require('@/utils/got');
const common = require('./common');
const cheerio = require('cheerio');
const dayjs = require('dayjs');
@@ -6,7 +6,7 @@ const dayjs = require('dayjs');
module.exports = async (ctx) => {
const id = ctx.params.id;
const response = await axios({
const response = await got({
method: 'post',
url: 'https://app.jike.ruguoapp.com/1.0/messages/history',
headers: {
@@ -44,7 +44,7 @@ module.exports = async (ctx) => {
if (cache) {
item.description = cache;
} else {
const { data } = await axios.get(newsUrl);
const { data } = await got.get(newsUrl);
const $ = cheerio.load(data);
const upper = $('ul.main > li.item');
const links = upper.find('a').map((_, ele) => $(ele).attr('href'));