@Value和static冲突,获取Apollo数据null解决
@Componentpublic class Config { @Value("${config1}") private static String config1; }使用上面这种方式,config1会返回null正确写法@Componentpublic class Config { private static String config1; public static String getConfig1() { ret..
转载
2022-05-07 09:19:12 ·
736 阅读 ·
0 评论