一:springboot 1 版本时候 cloud的配置中心中文乱码解决
1.继承 PropertySourceLoader 接口实现内部2个方法
2.在 resources下创建 META-INF 目录 并在目录下创建spring.factories文件
文件内
org.springframework.boot.env.PropertySourceLoader=com.spring.cloud.configServer.config.MyPropertiesHandler(你的自定类路径)
二:springboot 2 版本时候 cloud的配置中心中文乱码解决
1. 同样继承 PropertySourceLoader 接口实现内部2个方法 只是 load()方法的返回值变为集合了
2.在 resources下创建 META-INF 目录 并在目录下创建spring.factories文件
文件内
org.springframework.boot.env.PropertySourceLoader=com.spring.cloud.configServer.config.MyPropertiesHandler(你的自定类路径)