|
@@ -58,42 +58,7 @@ public class ShiroServiceImpl implements ShiroService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void updateOrganizeInfo(CmMallOrganize mallOrganize) {
|
|
public void updateOrganizeInfo(CmMallOrganize mallOrganize) {
|
|
- if (mallOrganize.getIntroduction() != null) {
|
|
|
|
- mallOrganize.setIntroduction(alter(mallOrganize.getIntroduction()));
|
|
|
|
- }
|
|
|
|
- if (mallOrganize.getAfterSale() != null) {
|
|
|
|
- mallOrganize.setAfterSale(alter(mallOrganize.getAfterSale()));
|
|
|
|
- }
|
|
|
|
- if (mallOrganize.getShoppingNotes() != null) {
|
|
|
|
- mallOrganize.setShoppingNotes(alter(mallOrganize.getShoppingNotes()));
|
|
|
|
- }
|
|
|
|
mallOrganize.setUpdateTime(new Date().toString());
|
|
mallOrganize.setUpdateTime(new Date().toString());
|
|
userDao.updateOrganizeInfo(mallOrganize);
|
|
userDao.updateOrganizeInfo(mallOrganize);
|
|
}
|
|
}
|
|
-
|
|
|
|
- public String alter(String introduction) {
|
|
|
|
- introduction = StringUtils.replace(introduction, "<body", "<div");
|
|
|
|
- introduction = StringUtils.replace(introduction, "</body>", "</div>");
|
|
|
|
- Document doc = Jsoup.parse(introduction);
|
|
|
|
- Elements links = doc.getElementsByTag("img");
|
|
|
|
- for (Element link : links) {
|
|
|
|
- String linkSrc = link.attr("src");
|
|
|
|
- String linkSrcOld = link.attr("src");
|
|
|
|
- if (StringUtils.isNotBlank(linkSrc) && !linkSrc.contains("http:") && !linkSrc.contains("https:") && !linkSrc.contains("uploadFile/ueditor")) {//不包含http开头的
|
|
|
|
- linkSrc = Encodes.urlDecode(linkSrc);
|
|
|
|
- /*String realPath = UploadImageUtils.getAbsolutePath(linkSrc);
|
|
|
|
- int pointerIndex = realPath.lastIndexOf(".");
|
|
|
|
- ImageUploadInfo saveImageSerivce = new ImageUploadInfo();
|
|
|
|
- try {
|
|
|
|
- saveImageSerivce = ImagePathUtils.saveImageSerivce(realPath, pointerIndex, realPath);
|
|
|
|
- String src = photoServer + saveImageSerivce.getSource();
|
|
|
|
- introduction = StringUtils.replace(introduction, linkSrcOld, src);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
- //logger.error("图片上传错误:" + e.toString(), e);
|
|
|
|
- }*/
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return introduction;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|