@Component
public class MyConfig {

private static String env;

public static String getEnv() {
return env;
}

@Value("${env}")
public void setEnv(String env) {
MyConfig.env = env;
}
}

 


原文链接:https://blog.csdn.net/dadaoke/article/details/79460677