diff --git a/modules/web/src/views/BookChapter.vue b/modules/web/src/views/BookChapter.vue index 966c6ac3a..4bc24f33a 100644 --- a/modules/web/src/views/BookChapter.vue +++ b/modules/web/src/views/BookChapter.vue @@ -305,6 +305,11 @@ const getContent = (index: number, reloadChapter = true, chapterPos = 0) => { if (res.data.isSuccess) { const data = res.data.data const content = data.split(/\n+/) + for (let i = 0; i < content.length; i++) { + if (!/^\s*]*src[^>]+>$/.test(content[i])) { + content[i] = content[i].replaceAll('img src="', `img src="/image?url=${bookUrl}&path=`); + } + } chapterData.value.push({ index, content, title }) if (reloadChapter) toChapterPos(chapterPos) } else {