优化代码

This commit is contained in:
java110 2022-05-18 16:12:18 +08:00
parent 8bbe18e4a0
commit 4c74974cfc
2 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@ export function replaceImgSrc(_content, _url) {
if (isEmpty(_content)) {
return _content;
}
_content = _content.replaceAll("&","&")
// a 为富文本的字符串内容为了测试只写了img标签
let b = /<img [^>]*src=['"]([^'"]+)[^>]*>/g; // img 标签取src里面内容的正则
let s = _content.match(b); // 取到所有img标签 放到数组 s里面

View File

@ -77,7 +77,7 @@
let _tmpStartTime = new Date(_startTime);
// _item.startTime = _that.java110Util.date.formatDate(_tmpStartTime);
_item.context = replaceImgSrc(_item.context,conf.baseUrl);
_item.context = replaceImgSrc(_item.context,conf.commonBaseUrl);
_that.activity = _item;
});