# Conflicts: # dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java # dq-financial-hrms-auth/src/main/resources/bootstrap.propertiesmaster
commit
de116e0b27
15 changed files with 146 additions and 103 deletions
@ -1,34 +1,36 @@ |
||||
package com.daqing.financial.hrms.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; |
||||
|
||||
/** |
||||
* 实现基本的跨域请求 |
||||
* |
||||
* @auther River |
||||
* @date 2020/9/25 15:09 |
||||
*/ |
||||
@Configuration |
||||
public class CorsConfig { |
||||
|
||||
@Bean |
||||
public CorsFilter corsFilter() { |
||||
final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource(); |
||||
final CorsConfiguration corsConfiguration = new CorsConfiguration(); |
||||
/*是否允许请求带有验证信息*/ |
||||
corsConfiguration.setAllowCredentials(true); |
||||
/*允许访问的客户端域名*/ |
||||
corsConfiguration.addAllowedOrigin("*"); |
||||
/*允许服务端访问的客户端请求头*/ |
||||
corsConfiguration.addAllowedHeader("*"); |
||||
/*允许访问的方法名,GET POST等*/ |
||||
corsConfiguration.addAllowedMethod("*"); |
||||
urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration); |
||||
return new CorsFilter(urlBasedCorsConfigurationSource); |
||||
} |
||||
} |
||||
//TODO:跨域注解,上线时注解掉,网关已经统一处理了
|
||||
//package com.daqing.financial.hrms.config;
|
||||
//
|
||||
//import org.springframework.cloud.client.discovery.DiscoveryClient;
|
||||
//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;
|
||||
//
|
||||
///**
|
||||
// * 实现基本的跨域请求
|
||||
// *
|
||||
// * @auther River
|
||||
// * @date 2020/9/25 15:09
|
||||
// */
|
||||
//@Configuration
|
||||
//public class CorsConfig {
|
||||
//
|
||||
// @Bean
|
||||
// public CorsFilter corsFilter() {
|
||||
// final UrlBasedCorsConfigurationSource urlBasedCorsConfigurationSource = new UrlBasedCorsConfigurationSource();
|
||||
// final CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
// //是否允许请求带有验证信息
|
||||
// corsConfiguration.setAllowCredentials(true);
|
||||
// //允许访问的客户端域名
|
||||
// corsConfiguration.addAllowedOrigin("*");
|
||||
// //允许服务端访问的客户端请求头
|
||||
// corsConfiguration.addAllowedHeader("*");
|
||||
// //允许访问的方法名,GET POST等
|
||||
// corsConfiguration.addAllowedMethod("*");
|
||||
// urlBasedCorsConfigurationSource.registerCorsConfiguration("/**", corsConfiguration);
|
||||
// return new CorsFilter(urlBasedCorsConfigurationSource);
|
||||
// }
|
||||
//
|
||||
//}
|
||||
////TODO:跨域注解,上线时注解掉,网关已经统一处理了
|
||||
|
@ -1,61 +1,61 @@ |
||||
##服务名称 |
||||
#spring.application.name=dq-financial-hrms |
||||
##配置中心地址 |
||||
#spring.cloud.nacos.config.server-addr=192.168.31.142:8848 |
||||
#spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6 |
||||
##spring.cloud.nacos.config.group=prod |
||||
# |
||||
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml |
||||
#spring.cloud.nacos.config.ext-config[0].group=dev |
||||
#spring.cloud.nacos.config.ext-config[0].refresh=true |
||||
# |
||||
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml |
||||
#spring.cloud.nacos.config.ext-config[1].group=dev |
||||
#spring.cloud.nacos.config.ext-config[1].refresh=true |
||||
# |
||||
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml |
||||
#spring.cloud.nacos.config.ext-config[2].group=dev |
||||
#spring.cloud.nacos.config.ext-config[2].refresh=true |
||||
# |
||||
#spring.redis.host=127.0.0.1 |
||||
#spring.redis.port=6379 |
||||
#spring.redis.password=123456 |
||||
#spring.redis.database=0 |
||||
#spring.redis.timeout=30000 |
||||
#spring.redis.jedis.pool.max-active=8 |
||||
#spring.redis.jedis.pool.max-wait=-1 |
||||
#spring.redis.jedis.pool.max-idle=8 |
||||
#spring.redis.jedis.pool.min-idle=0 |
||||
# |
||||
#spring.servlet.multipart.max-file-size=10MB |
||||
#spring.servlet.multipart.max-request-size=10MB |
||||
|
||||
# 正式环境(prod) |
||||
#服务名称 |
||||
spring.application.name=dq-financial-hrms |
||||
#配置中心地址 |
||||
spring.cloud.nacos.config.server-addr=120.78.127.12:8848 |
||||
spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43 |
||||
spring.cloud.nacos.config.server-addr=192.168.31.142:8848 |
||||
spring.cloud.nacos.config.namespace=4c56c2f9-b6a3-4e7b-88b8-b1001e86dfd6 |
||||
#spring.cloud.nacos.config.group=prod |
||||
|
||||
spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml |
||||
spring.cloud.nacos.config.ext-config[0].group=prod |
||||
spring.cloud.nacos.config.ext-config[0].group=dev |
||||
spring.cloud.nacos.config.ext-config[0].refresh=true |
||||
|
||||
spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml |
||||
spring.cloud.nacos.config.ext-config[1].group=prod |
||||
spring.cloud.nacos.config.ext-config[1].group=dev |
||||
spring.cloud.nacos.config.ext-config[1].refresh=true |
||||
|
||||
spring.cloud.nacos.config.ext-config[2].data-id=other.yml |
||||
spring.cloud.nacos.config.ext-config[2].group=prod |
||||
spring.cloud.nacos.config.ext-config[2].group=dev |
||||
spring.cloud.nacos.config.ext-config[2].refresh=true |
||||
|
||||
spring.redis.host=127.0.0.1 |
||||
spring.redis.host=192.168.232.128 |
||||
spring.redis.port=6379 |
||||
spring.redis.password=dq123456 |
||||
spring.redis.password= |
||||
spring.redis.database=0 |
||||
spring.redis.timeout=30000 |
||||
spring.redis.jedis.pool.max-active=8 |
||||
spring.redis.jedis.pool.max-wait=-1 |
||||
spring.redis.jedis.pool.max-idle=8 |
||||
spring.redis.jedis.pool.min-idle=0 |
||||
spring.redis.jedis.pool.min-idle=0 |
||||
|
||||
spring.servlet.multipart.max-file-size=10MB |
||||
spring.servlet.multipart.max-request-size=10MB |
||||
|
||||
#正式环境(prod) |
||||
#服务名称 |
||||
#spring.application.name=dq-financial-hrms |
||||
###配置中心地址 |
||||
##spring.cloud.nacos.config.server-addr=120.78.127.12:8848 |
||||
##spring.cloud.nacos.config.namespace=69614b55-1521-421c-ac58-dbe4a5b01b43 |
||||
###spring.cloud.nacos.config.group=prod |
||||
## |
||||
##spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml |
||||
##spring.cloud.nacos.config.ext-config[0].group=prod |
||||
##spring.cloud.nacos.config.ext-config[0].refresh=true |
||||
## |
||||
##spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml |
||||
##spring.cloud.nacos.config.ext-config[1].group=prod |
||||
##spring.cloud.nacos.config.ext-config[1].refresh=true |
||||
## |
||||
##spring.cloud.nacos.config.ext-config[2].data-id=other.yml |
||||
##spring.cloud.nacos.config.ext-config[2].group=prod |
||||
##spring.cloud.nacos.config.ext-config[2].refresh=true |
||||
## |
||||
##spring.redis.host=127.0.0.1 |
||||
##spring.redis.port=6379 |
||||
##spring.redis.password=dq123456 |
||||
##spring.redis.database=0 |
||||
##spring.redis.timeout=30000 |
||||
##spring.redis.jedis.pool.max-active=8 |
||||
##spring.redis.jedis.pool.max-wait=-1 |
||||
##spring.redis.jedis.pool.max-idle=8 |
||||
##spring.redis.jedis.pool.min-idle=0 |
Loading…
Reference in new issue