diff --git a/pages/message/detail.vue b/pages/message/detail.vue
index 950b102..79130df 100644
--- a/pages/message/detail.vue
+++ b/pages/message/detail.vue
@@ -13,7 +13,7 @@
-
+
@@ -36,6 +36,26 @@
}
},
methods: {
+ // 富文本处理
+ formatRichText(richText){
+ if(richText != null){
+ let newRichText= richText.replace(/
]*>/gi, function(match, capture){
+ match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
+ match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
+ match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
+ return match;
+ });
+ newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){
+ match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;');
+ return match;
+ });
+ newRichText = newRichText.replace(/
]*\/>/gi, '');
+ newRichText = newRichText.replace(/\
{
this.content = res.data?.content;
diff --git a/pages/notice/article.vue b/pages/notice/article.vue
index cbf7d58..a9c42ca 100644
--- a/pages/notice/article.vue
+++ b/pages/notice/article.vue
@@ -14,7 +14,7 @@
-
+
@@ -63,6 +63,26 @@
}
},
methods: {
+ // 富文本处理
+ formatRichText(richText){
+ if(richText != null){
+ let newRichText= richText.replace(/
]*>/gi, function(match, capture){
+ match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
+ match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
+ match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
+ return match;
+ });
+ newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){
+ match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;');
+ return match;
+ });
+ newRichText = newRichText.replace(/
]*\/>/gi, '');
+ newRichText = newRichText.replace(/\
{
this.content = res.data?.content;
diff --git a/pages/notice/notice.vue b/pages/notice/notice.vue
index 18f6ed1..a568967 100644
--- a/pages/notice/notice.vue
+++ b/pages/notice/notice.vue
@@ -13,7 +13,7 @@
-
+
@@ -36,6 +36,26 @@
}
},
methods: {
+ // 富文本处理
+ formatRichText(richText){
+ if(richText != null){
+ let newRichText= richText.replace(/
]*>/gi, function(match, capture){
+ match = match.replace(/style="[^"]+"/gi, '').replace(/style='[^']+'/gi, '');
+ match = match.replace(/width="[^"]+"/gi, '').replace(/width='[^']+'/gi, '');
+ match = match.replace(/height="[^"]+"/gi, '').replace(/height='[^']+'/gi, '');
+ return match;
+ });
+ newRichText = newRichText.replace(/style="[^"]+"/gi,function(match, capture){
+ match = match.replace(/width:[^;]+;/gi, 'width:100%;').replace(/width:[^;]+;/gi, 'width:100%;');
+ return match;
+ });
+ newRichText = newRichText.replace(/
]*\/>/gi, '');
+ newRichText = newRichText.replace(/\
{
this.content = res.data?.content;