From 747e70dd6ec1d0e147a4d579d9f0e268378ac743 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 13 Aug 2025 13:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=97=E6=88=98=20=E4=B9=A6=E6=88=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/detail/articleDetail.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/detail/articleDetail.vue b/packages/detail/articleDetail.vue index 80a53c4..85e05ef 100644 --- a/packages/detail/articleDetail.vue +++ b/packages/detail/articleDetail.vue @@ -19,8 +19,9 @@ - - + + + @@ -70,9 +71,17 @@ table_name: 'map_point_image_articles', 'with_relations[0]': 'image' }) - this.info = res + this.info = res + this.info.content = this.replaceStoragePath(res.content) + console.log(this.info.content) this.showContent = true - }, + }, + replaceStoragePath(htmlStr) { + // 正则匹配 src 属性中包含 ../storage 的部分(支持双引号或单引号) + const regex = /src=["']\..\/storage/g; + // 替换为目标路径(保持原有的引号) + return htmlStr.replace(regex, 'src="https://h5.jscnsaas.cn/storage'); + } } }