在org.springblade.core.tool.config.JacksonConfiguration中,注册了bladex提供的BladeJavaTimeModule ,但实际并未生效
//日期格式化 objectMapper.registerModule(BladeJavaTimeModule.INSTANCE); objectMapper.findAndRegisterModules();
这是因为objectMapper默认IGNORE_DUPLICATE_MODULE_REGISTRATIONS属性是true,注册时遇到同名的模块会跳过,这里需要进行如下修改
//日期格式化 objectMapper.configure(MapperFeature.IGNORE_DUPLICATE_MODULE_REGISTRATIONS, false); objectMapper.registerModule(BladeJavaTimeModule.INSTANCE); objectMapper.configure(MapperFeature.IGNORE_DUPLICATE_MODULE_REGISTRATIONS, true); objectMapper.findAndRegisterModules();
望修复
扫一扫访问 Blade技术社区 移动端