From 2e853bb77cbe205d0dc3b4a72be2fc7c869e28fe Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 25 Nov 2019 15:52:23 +0800 Subject: [PATCH] 2.5.4 --- .../com/gitee/sop/websiteserver/config/WebsiteConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java index 335e0efb..388c7fca 100644 --- a/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java @@ -3,6 +3,7 @@ package com.gitee.sop.websiteserver.config; import com.alibaba.fastjson.serializer.SerializerFeature; import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import com.gitee.sop.gatewaycommon.manager.EnvironmentContext; import com.gitee.sop.gatewaycommon.route.EurekaRegistryListener; import com.gitee.sop.gatewaycommon.route.NacosRegistryListener; import com.gitee.sop.gatewaycommon.route.RegistryListener; @@ -20,6 +21,7 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.EventListener; +import org.springframework.core.env.Environment; /** * @author tanghc @@ -33,6 +35,9 @@ public class WebsiteConfig implements ApplicationRunner { @Autowired private RegistryListener registryListener; + @Autowired + private Environment environment; + /** * 使用fastjson代替jackson * @return @@ -84,6 +89,6 @@ public class WebsiteConfig implements ApplicationRunner { */ @Override public void run(ApplicationArguments args) throws Exception { -// docManager.load(null); + EnvironmentContext.setEnvironment(environment); } }