mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-10 23:34:38 +08:00
refactor: rename axios to got
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const axios = require('@/utils/axios');
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
const BASE_URL = 'https://minecraft.curseforge.com/';
|
||||
@@ -6,7 +6,7 @@ const BASE_URL = 'https://minecraft.curseforge.com/';
|
||||
module.exports = async (ctx) => {
|
||||
const { project } = ctx.params;
|
||||
const projectLink = `${BASE_URL}/projects/${project}/files`;
|
||||
const projectFilesReq = await axios.get(projectLink);
|
||||
const projectFilesReq = await got.get(projectLink);
|
||||
const { data } = projectFilesReq;
|
||||
const $ = cheerio.load(data);
|
||||
const projectName = $('.project-title span').text();
|
||||
@@ -23,7 +23,7 @@ module.exports = async (ctx) => {
|
||||
return JSON.parse(cache);
|
||||
}
|
||||
|
||||
const itemReq = await axios.get(document.link);
|
||||
const itemReq = await got.get(document.link);
|
||||
const $item = cheerio.load(itemReq.data);
|
||||
const supportVersions = $item('.details-versions li')
|
||||
.get()
|
||||
|
||||
Reference in New Issue
Block a user