FastJSON 2.x 只有个别第三方在使用,1.x 已经没有再用了,代码移除

This commit is contained in:
thinkgem
2025-05-12 11:02:30 +08:00
parent 681f4e7510
commit 8789c83942

View File

@@ -4,7 +4,6 @@
*/ */
package com.jeesite.common.io; package com.jeesite.common.io;
import com.alibaba.fastjson.parser.ParserConfig;
import com.jeesite.common.lang.StringUtils; import com.jeesite.common.lang.StringUtils;
import org.springframework.boot.env.OriginTrackedMapPropertySource; import org.springframework.boot.env.OriginTrackedMapPropertySource;
import org.springframework.boot.env.PropertiesPropertySourceLoader; import org.springframework.boot.env.PropertiesPropertySourceLoader;
@@ -39,12 +38,12 @@ public class PropertyLoader implements org.springframework.boot.env.PropertySour
List<PropertySource<?>> propertySources = new ArrayList<>(); List<PropertySource<?>> propertySources = new ArrayList<>();
if (!isLoadJeeSitePropertySource) { if (!isLoadJeeSitePropertySource) {
isLoadJeeSitePropertySource = true; isLoadJeeSitePropertySource = true;
try { // try {
// 默认开启 FastJSON 1.x 的,安全模式 // // 默认开启 FastJSON 1.x 的,安全模式
ParserConfig.getGlobalInstance().setSafeMode(true); // ParserConfig.getGlobalInstance().setSafeMode(true);
} catch (Throwable ignored) { // } catch (Throwable ignored) {
// 兼容 FastJSON 2.x 的调用,忽略异常 // // 兼容 FastJSON 2.x 的调用,忽略异常
} // }
Properties properties = PropertiesUtils.getInstance().getProperties(); Properties properties = PropertiesUtils.getInstance().getProperties();
propertySources.add(new OriginTrackedMapPropertySource("jeesite", properties)); propertySources.add(new OriginTrackedMapPropertySource("jeesite", properties));
} else { } else {