Browse Source

代码微调

dev_shibei_match
jianjun 5 years ago
parent
commit
2ee24b2f39
  1. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

5
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

@ -11,6 +11,9 @@ import org.springframework.core.env.Environment;
* @date 2020-07-03 11:14
**/
public enum EnvEnum {
/**
* 环境变量枚举
*/
LOCAL("local", "本地环境", "http://localhost:8080/api/"),
DEV("dev", "开发环境", "http://192.168.1.130:8080/api/"),
TEST("test", "体验环境", "https://epmet-dev.elinkservice.cn/api/"),
@ -44,7 +47,7 @@ public enum EnvEnum {
try {
Environment environment = SpringContextUtils.getBean(Environment.class);
String[] activeProfiles = environment.getActiveProfiles();
if (activeProfiles != null && activeProfiles.length > 0) {
if (activeProfiles.length > 0) {
return getEnum(activeProfiles[0]);
}
} catch (Exception e) {

Loading…
Cancel
Save