From 701f2826b3ca273e9536bc4bd8f6c0f828bc45da Mon Sep 17 00:00:00 2001 From: HapeLee <1321903405@qq.com> Date: Mon, 1 Sep 2025 01:59:29 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20web=E4=B9=A6=E6=9E=B6=E8=AF=BB=E4=B9=A6?= =?UTF-8?q?=E7=AB=A0=E8=8A=82=E5=86=85=E5=AE=B9=E5=AD=98=E5=9C=A8=E5=A4=9A?= =?UTF-8?q?=E5=BC=A0=E5=9B=BE=E7=89=87=E6=97=B6=E4=BB=A3=E7=90=86=E5=9B=BE?= =?UTF-8?q?=E7=89=87url=E4=B8=AD=E7=9A=84bookUrl=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=9C=AAencodeURIComponent=E5=AF=BC=E8=87=B4=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E6=97=A0=E6=B3=95=E8=AE=BF=E9=97=AE=20=E6=84=9F?= =?UTF-8?q?=E8=B0=A2=EF=BC=9A@PanicNotPanic=E3=80=81@Panic=C2=B0=20Co-auth?= =?UTF-8?q?ored-by:=2017683954109@163.com=20<17683954109@163.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/web/src/views/BookChapter.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/web/src/views/BookChapter.vue b/modules/web/src/views/BookChapter.vue index 966c6ac3a..d022348b2 100644 --- a/modules/web/src/views/BookChapter.vue +++ b/modules/web/src/views/BookChapter.vue @@ -305,6 +305,12 @@ const getContent = (index: number, reloadChapter = true, chapterPos = 0) => { if (res.data.isSuccess) { const data = res.data.data const content = data.split(/\n+/) + const urlEncodedBookUrl = encodeURIComponent(bookUrl) + for (let i = 0; i < content.length; i++) { + if (!/^\s*]*src[^>]+>$/.test(content[i])) { + content[i] = content[i].replace(new RegExp('img src="', 'g'), `img src="/image?url=${urlEncodedBookUrl}&path=`); + } + } chapterData.value.push({ index, content, title }) if (reloadChapter) toChapterPos(chapterPos) } else {