页面修改图片路径

前台修改======================
"aTargets": [2],
"mData": null,
"mRender": function (data, type, full) {
var content = full.content;
var s = content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function (match, capture) {
return "<img src='"+capture.substring(1)+"' class='img-responsive'>";
});
return s;
}

后台修改====================----
String content = question.getContent();
String src = CommonUtil.getImgStr(content);
if(StrKit.notBlank(src)){
String newStr = CommonUtil.repairContent(content);
question.setContent(newStr);
}


/**

posted @ 2018-08-22 17:05  飞蚊  阅读(240)  评论(0编辑  收藏  举报