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([
|
||||
@@ -14,7 +14,7 @@ const categoryTitle = new Map([
|
||||
module.exports = async (ctx) => {
|
||||
const category = ctx.params.category;
|
||||
const link = `https://www.digitaling.com/projects/${category}`;
|
||||
const res = await axios.get(link);
|
||||
const res = await got.get(link);
|
||||
const $ = cheerio.load(res.data);
|
||||
// 标题
|
||||
const title = categoryTitle.get(category).name;
|
||||
@@ -31,7 +31,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