Browse Source

StringSource 缓存 key 直接使用内容本身

James 1 year ago
parent
commit
b936aa26c0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main/java/com/jfinal/template/source/StringSource.java

+ 2 - 2
src/main/java/com/jfinal/template/source/StringSource.java

@@ -33,7 +33,7 @@ public class StringSource implements ISource {
 	 * @param cache true 则缓存 Template,否则不缓存
 	 */
 	public StringSource(String content, boolean cache) {
-		this(content, cache ? HashKit.md5(content) : null);
+		this(content, cache ? content : null);
 	}
 
 	/**
@@ -50,7 +50,7 @@ public class StringSource implements ISource {
 	}
 
 	public StringSource(StringBuilder content, boolean cache) {
-		this(content, cache && content != null ? HashKit.md5(content.toString()) : null);
+		this(content, cache && content != null ? content.toString() : null);
 	}
 
 	public StringSource(StringBuilder content, String cacheKey) {