fix: 修复tts代理不正确问题

This commit is contained in:
ikechan8370 2023-10-16 16:57:52 +08:00
parent 0e826e58a8
commit 6c171b32a1

View file

@ -2,14 +2,8 @@ import { Config } from './config.js'
import fetch from 'node-fetch' import fetch from 'node-fetch'
import _ from 'lodash' import _ from 'lodash'
import { wrapTextByLanguage } from './common.js' import { wrapTextByLanguage } from './common.js'
let proxy import { getProxy } from './proxy.js'
if (Config.proxy) { let proxy = getProxy()
try {
proxy = (await import('https-proxy-agent')).default
} catch (e) {
console.warn('未安装https-proxy-agent请在插件目录下执行pnpm add https-proxy-agent')
}
}
const newFetch = (url, options = {}) => { const newFetch = (url, options = {}) => {
const defaultOptions = Config.proxy const defaultOptions = Config.proxy