Преглед на файлове

ShowList管理优化-图片上传阿里云

zhangqiang преди 8 месеца
родител
ревизия
4f3f22ac90

+ 4 - 0
jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/okki/showlist/service/impl/OkkiShowlistServiceImpl.java

@@ -244,6 +244,8 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 					okkiOverviews.get(0).setPic(imgUrl);
 				}
 				// 将内容中图片地址获取到
+				// 将所有src="../../替换成domain
+				okkiOverviews.get(0).setContent(okkiOverviews.get(0).getContent().replaceAll("src=\"../..", domain));
 				final ArrayList<String> imgTags = findImgTags(okkiOverviews.get(0).getContent());
 				if (imgTags.size()>0) {
 					for (String imgTag : imgTags) {
@@ -301,6 +303,8 @@ public class OkkiShowlistServiceImpl extends ServiceImpl<OkkiShowlistMapper, Okk
 			// 处理优势内容图片
 			// 将内容中图片地址获取到
 			if (okkiShowlist.getAdvantageContent() != null) {
+				// 将所有src="../../替换成domain
+				okkiShowlist.setAdvantageContent(okkiShowlist.getAdvantageContent().replaceAll("src=\"../..", domain));
 				final ArrayList<String> imgTags = findImgTags(okkiShowlist.getAdvantageContent());
 				if (imgTags.size()>0) {
 					for (String imgTag : imgTags) {