mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: 修复tts代理不正确问题
This commit is contained in:
parent
0e826e58a8
commit
6c171b32a1
1 changed files with 2 additions and 8 deletions
10
utils/tts.js
10
utils/tts.js
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue