ConfigUtil 类
package com.xys.java_test.utils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ConfigUtil {
public static String envStr;
@Value("${spring.profiles.active}")
public void setV(String v) {
System.out.println("envStr:" + v);
ConfigUtil.envStr = v;
}
}