liupeng 5 years ago
parent
commit
6be0105529

+ 2 - 19
code/sapparent/sapcms/src/main/java/org/fouram/listener/SystemInitListener.java

@@ -1,15 +1,10 @@
 package org.fouram.listener;
 
-import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
 
-import org.fouram.core.base.constants.SysConstants;
-import org.fouram.core.base.constants.SysConstants.ConstSession;
+import org.fouram.core.util.ConfConfig;
 import org.fouram.core.util.LoggerUtil;
-import org.fouram.service.SysDictionaryService;
-import org.springframework.web.context.WebApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
 
 /**
  * 加载系统配置文件
@@ -26,22 +21,10 @@ public class SystemInitListener implements ServletContextListener {
 
 	@Override
 	public void contextInitialized(ServletContextEvent config) {
-		ServletContext application = config.getServletContext();
 		try {
 			// 开启log4j2全异步模式
 			System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
-			WebApplicationContext springContext = WebApplicationContextUtils
-					.getWebApplicationContext(config.getServletContext());
-			SysDictionaryService sysDictionaryService = (SysDictionaryService) springContext
-					.getBean("sysDictionaryService");
-			String companyName = sysDictionaryService
-					.findOneByTypeAndKey(SysConstants.SysDictionaryTypeIndex, SysConstants.SysDictionaryKeyCompanyName)
-					.getValue();
-			String cmsName = sysDictionaryService
-					.findOneByTypeAndKey(SysConstants.SysDictionaryTypeIndex, SysConstants.SysDictionaryKeyCmsName)
-					.getValue();
-			application.setAttribute(ConstSession.SESSION_COMPANY_NAME, companyName);
-			application.setAttribute(ConstSession.SESSION_CMS_NAME, cmsName);
+			LoggerUtil.info("ENV:" + ConfConfig.getConfigString("env"));
 		} catch (Exception e) {
 			LoggerUtil.error(e);
 		}