|
@@ -13,12 +13,16 @@ import org.springframework.web.client.RestTemplate;
|
|
|
*/
|
|
|
@Configuration
|
|
|
public class KubeSphereConfig {
|
|
|
+ public static String kubesphereUrl;
|
|
|
+
|
|
|
@Value("${kubesphereUrl}")
|
|
|
- private String kubesphereUrl;
|
|
|
+ public void setKubesphereUrl(String kubesphereUrl) {
|
|
|
+ KubeSphereConfig.kubesphereUrl = kubesphereUrl;
|
|
|
+ }
|
|
|
|
|
|
public static class URL {
|
|
|
|
|
|
- private static final String host = "http://42.192.195.253:30881";
|
|
|
+ private static final String host = KubeSphereConfig.kubesphereUrl;
|
|
|
// s2i相关url
|
|
|
public static final String S2I_BUILDER_URL = host + "/apis/devops.kubesphere.io/v1alpha1/namespaces/mkcloud/s2ibuilders";
|
|
|
public static final String S2I_CREATE_BINARY_QUERY_URL = host + "/apis/devops.kubesphere.io/v1alpha1/namespaces/mkcloud/s2ibinaries";
|
|
@@ -39,11 +43,25 @@ public class KubeSphereConfig {
|
|
|
public static final String OAUTH_TOKEN = host + "/oauth/token";
|
|
|
}
|
|
|
|
|
|
- public static final String ORIGIN = "http://42.192.195.253:30881";
|
|
|
+// public static final String ORIGIN = "http://42.192.195.253:30881";
|
|
|
+// public static final String UA = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36";
|
|
|
+// public static final String REFERER = "http://42.192.195.253:30881";
|
|
|
+// public static final String ACCEPT = "*/*";
|
|
|
+ public static String ORIGIN;
|
|
|
+ @Value("${kubesphereUrl}")
|
|
|
+ public static void setORIGIN(String ORIGIN) {
|
|
|
+ KubeSphereConfig.ORIGIN = ORIGIN;
|
|
|
+ }
|
|
|
+
|
|
|
public static final String UA = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36";
|
|
|
- public static final String REFERER = "http://42.192.195.253:30881";
|
|
|
- public static final String ACCEPT = "*/*";
|
|
|
|
|
|
+ public static String REFERER = KubeSphereConfig.kubesphereUrl;
|
|
|
+ @Value("${kubesphereUrl}")
|
|
|
+ public static void setREFERER(String REFERER) {
|
|
|
+ KubeSphereConfig.REFERER = REFERER;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static final String ACCEPT = "*/*";
|
|
|
|
|
|
@Bean
|
|
|
public RestTemplate restTemplate(RestTemplateBuilder builder) {
|