mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 pref: 修正未来可能出现的问题
This commit is contained in:
parent
f352b16f99
commit
a9cec8112a
@ -6,7 +6,7 @@ import { Buffer } from 'node:buffer';
|
|||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import tunnel from "tunnel";
|
import tunnel from "tunnel";
|
||||||
import HttpProxyAgent from "https-proxy-agent";
|
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||||
import { exec, execSync } from "child_process";
|
import { exec, execSync } from "child_process";
|
||||||
import { checkAndRemoveFile, deleteFolderRecursive, mkdirIfNotExists } from "../utils/file.js";
|
import { checkAndRemoveFile, deleteFolderRecursive, mkdirIfNotExists } from "../utils/file.js";
|
||||||
import {
|
import {
|
||||||
@ -676,7 +676,7 @@ export class tools extends plugin {
|
|||||||
"authorization": `Bearer ${ Buffer.from(TWITTER_BEARER_TOKEN, "base64").toString() }`
|
"authorization": `Bearer ${ Buffer.from(TWITTER_BEARER_TOKEN, "base64").toString() }`
|
||||||
},
|
},
|
||||||
...params,
|
...params,
|
||||||
agent: !isOversea ? '' : new HttpProxyAgent(this.myProxy),
|
agent: !isOversea ? '' : new HttpsProxyAgent(this.myProxy),
|
||||||
}).then(async resp => {
|
}).then(async resp => {
|
||||||
logger.info(resp)
|
logger.info(resp)
|
||||||
e.reply(`识别:小蓝鸟学习版,${ resp.data.text }`);
|
e.reply(`识别:小蓝鸟学习版,${ resp.data.text }`);
|
||||||
@ -889,7 +889,7 @@ export class tools extends plugin {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
timeout: 10000,
|
timeout: 10000,
|
||||||
agent: isOversea ? '' : new HttpProxyAgent(this.myProxy),
|
agent: isOversea ? '' : new HttpsProxyAgent(this.myProxy),
|
||||||
redirect: "follow",
|
redirect: "follow",
|
||||||
follow: 10,
|
follow: 10,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user