解决富文本图片在门户网站不能显示问题
This commit is contained in:
parent
549674700f
commit
bc4be6de75
@ -134,6 +134,7 @@ public class HelpDetailAppController extends DefaultBaseController {
|
||||
@GetMapping("listrelease")
|
||||
public List<HelpDetailDTO> listrelease() {
|
||||
Map<String, Object> params = requestParams();
|
||||
params.put("forPortal", "yes");
|
||||
return helpDetailService.list(params);
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,7 @@ public class NewsAppController extends DefaultBaseController {
|
||||
public List<NewsDTO> listRelease() {
|
||||
Map<String, Object> params = requestParams();
|
||||
params.put("sendStatus", "published");
|
||||
params.put("forPortal", "yes");
|
||||
return newsService.list(params);
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,17 @@ public class HelpDetailServiceImpl extends DefaultBaseService implements IHelpDe
|
||||
|
||||
@Override
|
||||
public List<HelpDetailDTO> list(Map<String, Object> params) {
|
||||
return helpDetailDao.list(params);
|
||||
List<HelpDetailDTO> list = helpDetailDao.list(params);
|
||||
if(null != params.get("forPortal")) {
|
||||
list.forEach(dto -> {
|
||||
// System.out.println("-----" + dto.getRichContent());
|
||||
String replacedText = dto.getRichContent().replaceAll("<img src=\"route/file(.*?)\"",
|
||||
"<img src=\"https://www.aimzhu.com/operator/route/file$1\"");
|
||||
dto.setRichContent(replacedText);
|
||||
// System.out.println("*****" + dto.getRichContent());
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -155,6 +155,14 @@ public class NewsServiceImpl extends DefaultBaseService implements INewsService
|
||||
newsDTO.setPublishTimeSub1(newsDTO.getPublishTime().substring(0, 7));
|
||||
newsDTO.setPublishTimeSub2(newsDTO.getPublishTime().substring(8));
|
||||
}
|
||||
|
||||
if(null != params.get("forPortal")) {
|
||||
// System.out.println("-----" + newsDTO.getContent());
|
||||
String replacedText = newsDTO.getContent().replaceAll("<img src=\"route/file(.*?)\"",
|
||||
"<img src=\"https://www.aimzhu.com/operator/route/file$1\"");
|
||||
newsDTO.setContent(replacedText);
|
||||
// System.out.println("*****" + newsDTO.getContent());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user