Browse Source

!43 水印其他属性不知道动态传入的问题

* 水印除文本外其他属性可通过url动态传入
pull/46/MERGE
shenghuadun 2 years ago committed by 陈精华
parent
commit
6efe15788c
  1. 27
      server/src/main/java/cn/keking/web/filter/AttributeSetFilter.java

27
server/src/main/java/cn/keking/web/filter/AttributeSetFilter.java

@ -48,15 +48,24 @@ public class AttributeSetFilter implements Filter {
private void setWatermarkAttribute(ServletRequest request) { private void setWatermarkAttribute(ServletRequest request) {
String watermarkTxt = request.getParameter("watermarkTxt"); String watermarkTxt = request.getParameter("watermarkTxt");
request.setAttribute("watermarkTxt", watermarkTxt != null ? watermarkTxt : WatermarkConfigConstants.getWatermarkTxt()); request.setAttribute("watermarkTxt", watermarkTxt != null ? watermarkTxt : WatermarkConfigConstants.getWatermarkTxt());
request.setAttribute("watermarkXSpace", WatermarkConfigConstants.getWatermarkXSpace()); String watermarkXSpace = request.getParameter("watermarkXSpace");
request.setAttribute("watermarkYSpace", WatermarkConfigConstants.getWatermarkYSpace()); request.setAttribute("watermarkXSpace", watermarkXSpace != null ? watermarkXSpace : WatermarkConfigConstants.getWatermarkXSpace());
request.setAttribute("watermarkFont", WatermarkConfigConstants.getWatermarkFont()); String watermarkYSpace = request.getParameter("watermarkYSpace");
request.setAttribute("watermarkFontsize", WatermarkConfigConstants.getWatermarkFontsize()); request.setAttribute("watermarkYSpace", watermarkYSpace != null ? watermarkYSpace : WatermarkConfigConstants.getWatermarkYSpace());
request.setAttribute("watermarkColor", WatermarkConfigConstants.getWatermarkColor()); String watermarkFont = request.getParameter("watermarkFont");
request.setAttribute("watermarkAlpha", WatermarkConfigConstants.getWatermarkAlpha()); request.setAttribute("watermarkFont", watermarkFont != null ? watermarkFont : WatermarkConfigConstants.getWatermarkFont());
request.setAttribute("watermarkWidth", WatermarkConfigConstants.getWatermarkWidth()); String watermarkFontsize = request.getParameter("watermarkFontsize");
request.setAttribute("watermarkHeight", WatermarkConfigConstants.getWatermarkHeight()); request.setAttribute("watermarkFontsize", watermarkFontsize != null ? watermarkFontsize : WatermarkConfigConstants.getWatermarkFontsize());
request.setAttribute("watermarkAngle", WatermarkConfigConstants.getWatermarkAngle()); String watermarkColor = request.getParameter("watermarkColor");
request.setAttribute("watermarkColor", watermarkColor != null ? watermarkColor : WatermarkConfigConstants.getWatermarkColor());
String watermarkAlpha = request.getParameter("watermarkAlpha");
request.setAttribute("watermarkAlpha", watermarkAlpha != null ? watermarkAlpha : WatermarkConfigConstants.getWatermarkAlpha());
String watermarkWidth = request.getParameter("watermarkWidth");
request.setAttribute("watermarkWidth", watermarkWidth != null ? watermarkWidth : WatermarkConfigConstants.getWatermarkWidth());
String watermarkHeight = request.getParameter("watermarkHeight");
request.setAttribute("watermarkHeight", watermarkHeight != null ? watermarkHeight : WatermarkConfigConstants.getWatermarkHeight());
String watermarkAngle = request.getParameter("watermarkAngle");
request.setAttribute("watermarkAngle", watermarkAngle != null ? watermarkAngle : WatermarkConfigConstants.getWatermarkAngle());
} }
@Override @Override

Loading…
Cancel
Save