From 86cfca8da082545fa2e03545c312a2efe092d7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E9=9B=A8=E2=97=8E=E6=98=9F=E7=A9=BA?= Date: Tue, 28 Mar 2023 12:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E6=96=87=E4=BB=B6=20URL=20?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=20file://=20(#533)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/character/AvatarCard.js | 2 +- apps/character/ImgUpload.js | 2 +- apps/profile/ProfileUtils.js | 4 ++-- apps/wiki/CharWiki.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/character/AvatarCard.js b/apps/character/AvatarCard.js index 30c9ebe7..8f0b17b4 100644 --- a/apps/character/AvatarCard.js +++ b/apps/character/AvatarCard.js @@ -42,7 +42,7 @@ let Avatar = { } let bg = char.getCardImg(Cfg.get('charPicSe', false)) if (renderType === 'photo') { - e.reply(segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + bg.img)) + e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${bg.img}`)) return true } let uid = e.uid || (e.targetUser && e.targetUser.uid) diff --git a/apps/character/ImgUpload.js b/apps/character/ImgUpload.js index 12cf6ecb..ad7f25e3 100644 --- a/apps/character/ImgUpload.js +++ b/apps/character/ImgUpload.js @@ -234,7 +234,7 @@ export async function profileImgList (e) { // 合并转发最多99? 但是我感觉不会有这么多先不做处理 console.log(`${path}${imgs[i]}`) msglist.push({ - message: [`${i + 1}.`, segment.image(`${path}/${imgs[i]}`)], + message: [`${i + 1}.`, segment.image(`file://${path}/${imgs[i]}`)], nickname: nickname, user_id: Bot.uin }) diff --git a/apps/profile/ProfileUtils.js b/apps/profile/ProfileUtils.js index 4453f80a..8ca686d7 100644 --- a/apps/profile/ProfileUtils.js +++ b/apps/profile/ProfileUtils.js @@ -44,7 +44,7 @@ export async function getOriginalPicture (e) { } } if (imgPath && imgPath.img) { - e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + decodeURIComponent(imgPath.img))], false, { recallMsg: 30 }) + e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${decodeURIComponent(imgPath.img)}`), false, { recallMsg: 30 }) } return true } @@ -52,7 +52,7 @@ export async function getOriginalPicture (e) { let time = new Date() // 对at错图像的增加嘲讽... if (time / 1000 - source.time < 3600) { - e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/common/face/what.jpg')]) + e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/common/face/what.jpg`)) return true } } diff --git a/apps/wiki/CharWiki.js b/apps/wiki/CharWiki.js index 074a67e3..11b37e12 100644 --- a/apps/wiki/CharWiki.js +++ b/apps/wiki/CharWiki.js @@ -53,7 +53,7 @@ const CharWiki = { if (mode === 'pic') { let img = char.getCardImg(Cfg.get('charPicSe', false), false) if (img && img.img) { - e.reply(segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + img.img)) + e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${img.img}`)) } else { e.reply('暂无图片') }