Commit 5cf40c8e by 黄超华

解决报错问题

1 parent 65b95690
......@@ -25,7 +25,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
@Component
public class GatewayJwtUtils implements InitializingBean {
public class GatewayJwtUtils {
private static final Logger log = LoggerFactory.getLogger(GatewayJwtUtils.class);
private static final String PAYLOAD_MAP = "payloadMap";
......@@ -39,11 +39,6 @@ public class GatewayJwtUtils implements InitializingBean {
public GatewayJwtUtils() {
}
@Override
public void afterPropertiesSet() throws Exception {
}
public static void main(String[] args) {
// GatewayService gatewayService = GatewayService.builder().name("scrm-shopmall")
// .remark("scrm商城")
......
#项目名称
spring.application.name=platform-auth
server.servlet.context-path=/${spring.application.name}
server.servlet.context-path=/auth
server.port=8081
#日志路径(logback-spring.xml读取,不要加入配置中心)
logging.path=/data/java_log/jetty/${spring.application.name}/${spring.application.name}.log
......
......@@ -17,7 +17,7 @@ import static java.util.TimeZone.getTimeZone;
*/
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"cn.com.glsx.*.api"})
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication(scanBasePackages = {"cn.com.glsx.*"}, exclude = DataSourceAutoConfiguration.class)
public class Application {
public static void main(String[] args) {
......
package com.glsx.plat.gateway.config;
import cn.com.glsx.auth.config.ApiGatewayServiceConfig;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.event.EnableBodyCachingEvent;
import org.springframework.cloud.gateway.filter.AdaptCachedBodyGlobalFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import javax.annotation.PostConstruct;
import java.util.stream.Collectors;
@Configuration
@EnableConfigurationProperties({ApiGatewayRetryConfig.class, ApiGatewayServiceConfig.class})
......@@ -29,4 +35,10 @@ public class ApiGatewayConfig {
adaptCachedBodyGlobalFilter.onApplicationEvent(enableBodyCachingEvent);
});
}
@Bean
@ConditionalOnMissingBean
public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) {
return new HttpMessageConverters(converters.orderedStream().collect(Collectors.toList()));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!