|
|
@@ -22,6 +22,8 @@ public class EnvCommonService {
|
|
|
|
|
|
public static final String active_prd = "prd";
|
|
|
|
|
|
+ public static final String active_pre = "pre";
|
|
|
+
|
|
|
public static String DISTRIBUTE_DEFAULT_URL_PREFIX;
|
|
|
|
|
|
@Value(value = "${spring.profiles.active}")
|
|
|
@@ -31,21 +33,28 @@ public class EnvCommonService {
|
|
|
private String domain;
|
|
|
|
|
|
public String getHost() {
|
|
|
+ if (isPreEnv()) {
|
|
|
+ return domain.replaceAll("8081", "8082");
|
|
|
+ }
|
|
|
return domain;
|
|
|
}
|
|
|
|
|
|
public String getDomain() {
|
|
|
- return this.getHost().substring(0, this.getHost().indexOf("8081"));
|
|
|
+ return this.getHost().substring(0, this.getHost().indexOf("80"));
|
|
|
}
|
|
|
|
|
|
public String getDomain2() {
|
|
|
- return this.getHost().substring(0, this.getHost().indexOf("/8081"));
|
|
|
+ return this.getHost().substring(0, this.getHost().indexOf("/80"));
|
|
|
}
|
|
|
|
|
|
public Boolean isPrdEnv() {
|
|
|
return EnvCommonService.active_prd.equals(getEnv());
|
|
|
}
|
|
|
|
|
|
+ public Boolean isPreEnv() {
|
|
|
+ return EnvCommonService.active_pre.equals(getEnv());
|
|
|
+ }
|
|
|
+
|
|
|
@PostConstruct
|
|
|
public void getDistributeUrl() {
|
|
|
DISTRIBUTE_DEFAULT_URL_PREFIX = getDomain();
|