|
@@ -3,6 +3,7 @@ package com.tzld.longarticle.recommend.server.util;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
import com.google.gson.Gson;
|
|
|
+import com.google.gson.GsonBuilder;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
@@ -27,7 +28,7 @@ public class JSONUtils {
|
|
|
return "";
|
|
|
}
|
|
|
try {
|
|
|
- return new Gson().toJson(obj);
|
|
|
+ return new GsonBuilder().disableHtmlEscaping().create().toJson(obj);
|
|
|
} catch (Exception e) {
|
|
|
log.error("toJson exception", e);
|
|
|
return "";
|