springboot用@Autowired和@PostConstruct注解把config配置读取到bean变成静态方法 @SpringBootApplication public class SendEmailApplication implements CommandLineRunner{ public static Configs conf; @Autowired private Configs conf2; @PostConstruct public void initconf() {…