//给富文本的图片 加上 http加域名 List<String> detaiList = HtmlUtil.getImgList(blog.getContent() ); Config config = (Config) servletContext.getAttribute("config"); //去重 LinkedHashSet<String> hashSet = new LinkedHashSet<>(detaiList); ArrayList<String> listWithoutDuplicates = new ArrayList<>(hashSet); //去重 for(String img: listWithoutDuplicates) { UUID uuid = UUID.randomUUID(); String tempString = blog.getContent().replace(img, config.getWebSite()+img); blog.setContent(tempString); } //给富文本的图片 加上 http加域名
站长微信:xiaomao0055
站长QQ:14496453