临时回滚enka的proxy能力,后续改为按需引入依赖

This commit is contained in:
Kokomi 2022-08-04 12:25:33 +08:00
parent 96044e5da0
commit f1c46510bd

View File

@ -1,6 +1,6 @@
import fetch from 'node-fetch' import fetch from 'node-fetch'
import EnkaData from './enka-data.js' import EnkaData from './enka-data.js'
import HttpsProxyAgent from "https-proxy-agent"; //import HttpsProxyAgent from "https-proxy-agent";
let Enka = { let Enka = {
key: 'enka', key: 'enka',
cd: 5, cd: 5,
@ -13,7 +13,7 @@ let Enka = {
} }
let config = { headers: { 'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent } } let config = { headers: { 'User-Agent': diyCfg?.enkaApi?.userAgent || sysCfg.enkaApi.userAgent } }
if (diyCfg?.enkaApi?.proxyAgent){ if (diyCfg?.enkaApi?.proxyAgent){
config.agent=new HttpsProxyAgent(diyCfg.enkaApi.proxyAgent) // config.agent=new HttpsProxyAgent(diyCfg.enkaApi.proxyAgent)
} }
let req = await fetch(api, config) let req = await fetch(api, config)
let data = await req.json() let data = await req.json()