Commit 7faa66bd by 刘亚鑫

Merge branch 'dev' of http://47.92.108.28/changchao/map-parent into dev

parents 3baff7fb 04fa1fa4
......@@ -69,9 +69,19 @@
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- 引入spring-data-elasticsearch-->
<dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>-->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>6.4.3</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>6.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
......
......@@ -9,6 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
public class AsjApplication {
public static void main(String[] args) {
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(AsjApplication.class, args);
}
}
package com.founder.asj.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/**
* Created by changc on 2018/9/7.
*
允许任何域名使用
允许任何头
允许任何方法(post、get等)
*/
@Configuration
public class CorsConfig {
private CorsConfiguration buildConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*"); // 1
corsConfiguration.addAllowedHeader("*"); // 2
corsConfiguration.addAllowedMethod("*"); // 3
corsConfiguration.setAllowCredentials(true);
return corsConfiguration;
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", buildConfig()); // 4
return new CorsFilter(source);
}
}
\ No newline at end of file
......@@ -16,4 +16,5 @@ spring.cloud.nacos.config.namespace=dev
#spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.shared-dataids=asjpz.properties
spring.cloud.nacos.config.refreshable-dataids=asjpz.properties
\ No newline at end of file
spring.cloud.nacos.config.refreshable-dataids=asjpz.properties
management.health.elasticsearch.enabled: false
\ No newline at end of file
......@@ -9,7 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
public class EsApplication {
public static void main(String[] args) {
//System.setProperty("es.set.netty.runtime.available.processors", "false");
System.setProperty("es.set.netty.runtime.available.processors", "false");
SpringApplication.run(EsApplication.class, args);
}
}
......@@ -16,4 +16,5 @@ spring.cloud.nacos.config.namespace=dev
#spring.cloud.nacos.config.ext-config[0].refresh=true
spring.cloud.nacos.config.shared-dataids=espz.properties
spring.cloud.nacos.config.refreshable-dataids=espz.properties
\ No newline at end of file
spring.cloud.nacos.config.refreshable-dataids=espz.properties
management.health.elasticsearch.enabled: false
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment