From eec5741dbdd1cf5732b43ca58a945a29a7c84c81 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Sun, 14 Jul 2024 22:45:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20pref:=20=E4=BC=98=E5=8C=96X?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 8 ++++---- utils/common.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index e30ee6c..7e7f94d 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -770,14 +770,14 @@ export class tools extends plugin { e.reply(segment.image(url)); } else { // 非海外使用🪜下载 - const proxy = this.myProxy; + const proxy = this.proxyAddr; const port = this.proxyPort; - const path = this.getCurDownloadPath(e); - downloadImg(url, path, "", !isOversea, {}, { + const localPath = this.getCurDownloadPath(e); + downloadImg(url, localPath, "", isOversea, {}, { proxyAddr: proxy, proxyPort: port }).then(path => { - e.reply(segment.image(fs.readFileSync(path))); + e.reply(segment.image(fs.readFileSync(localPath + "/" + url.split("/").pop()))); }); } } else { diff --git a/utils/common.js b/utils/common.js index 0168a0c..8a04cff 100644 --- a/utils/common.js +++ b/utils/common.js @@ -234,7 +234,7 @@ export async function downloadImg(img, dir, fileName = "", isProxy = false, head }); }); } catch (err) { - logger.error("图片下载失败"); + logger.error(`图片下载失败, 原因:${err}`); } }