From 8fdd10d1c2723ead1d2c3b232f64f292ba3ce1cc Mon Sep 17 00:00:00 2001 From: che_shuai <che_shuai@massclouds> Date: 星期一, 24 七月 2023 14:10:46 +0800 Subject: [PATCH] 修复在国标级联选择通道时,如果添加通道到跟平台根目录(即平台本身),无法触发目录变更事件问题.详见 https://github.com/648540858/wvp-GB28181-pro/issues/958 --- src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java index af3340d..886d6fa 100644 --- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java +++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java @@ -1,19 +1,22 @@ package com.genersoft.iot.vmp; -import java.util.logging.LogManager; - -import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport; -import com.genersoft.iot.vmp.storager.impl.RedisCatchStorageImpl; import com.genersoft.iot.vmp.utils.GitUtil; import com.genersoft.iot.vmp.utils.SpringBeanFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.scheduling.annotation.EnableScheduling; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; +import java.util.Collections; /** * 鍚姩绫� @@ -21,8 +24,7 @@ @ServletComponentScan("com.genersoft.iot.vmp.conf") @SpringBootApplication @EnableScheduling -@EnableDruidSupport -public class VManageBootstrap extends LogManager { +public class VManageBootstrap extends SpringBootServletInitializer { private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class); @@ -41,6 +43,21 @@ context.close(); VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args); } - + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(VManageBootstrap.class); + } + + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + super.onStartup(servletContext); + + servletContext.setSessionTrackingModes( + Collections.singleton(SessionTrackingMode.COOKIE) + ); + SessionCookieConfig sessionCookieConfig = servletContext.getSessionCookieConfig(); + sessionCookieConfig.setHttpOnly(true); + + } } -- Gitblit v1.8.0