springboot注册bean时,当使用@Value来获取.yml属性时,获取到到的数据为null的解决方案 对应的config内实现EnvironmentAware 接口通过我们定义的Environment来获取想要的参数即可使用的是getProperty()这个方法 例子: