参考我上面两篇文章有用到
转载:https://www.jianshu.com/p/7f75936b573b
例如拿到itcast值
@Value("${jwt.config.key}")
private String key;
或者
@Autowired
private Environment env`;
env.getProperty(“jwt.config.key”);
或者
@ConfigurationProperties(“jwt.config”)
public Class Test{
private String ket;
public void setKey(String key) {
this.key = key;
}
}