From dad8dfcadacaf262d7288126f1d09aa9fea19eac Mon Sep 17 00:00:00 2001 From: PanicNotPanic <935915822@qq.com> Date: Sat, 7 Jun 2025 21:06:46 +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(#5136)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 17683954109@163.com <17683954109@163.com> --- modules/web/src/views/BookChapter.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/web/src/views/BookChapter.vue b/modules/web/src/views/BookChapter.vue index b2792ddbc..d022348b2 100644 --- a/modules/web/src/views/BookChapter.vue +++ b/modules/web/src/views/BookChapter.vue @@ -305,9 +305,10 @@ 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=${bookUrl}&path=`); + content[i] = content[i].replace(new RegExp('img src="', 'g'), `img src="/image?url=${urlEncodedBookUrl}&path=`); } } chapterData.value.push({ index, content, title })