mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 08:10:32 +08:00
refactor: rename axios to got
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user