From 0371f5a96e8be9067b796c7b93ecf4d3bbdb99dc Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期一, 15 一月 2024 15:31:20 +0800
Subject: [PATCH] 修复国标级联全部添加与全部删除
---
src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java | 99 +++++++++++++++++++++++++++++++------------------
1 files changed, 63 insertions(+), 36 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
index 9dacbad..be57316 100644
--- a/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
+++ b/src/main/java/com/genersoft/iot/vmp/VManageBootstrap.java
@@ -1,36 +1,63 @@
-package com.genersoft.iot.vmp;
-
-import java.util.logging.LogManager;
-
-import com.genersoft.iot.vmp.conf.druid.EnableDruidSupport;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.web.servlet.ServletComponentScan;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import springfox.documentation.oas.annotations.EnableOpenApi;
-
-/**
- *
- */
-@ServletComponentScan("com.genersoft.iot.vmp.conf")
-@SpringBootApplication
-@EnableScheduling
-@EnableOpenApi
-@EnableDruidSupport
-public class VManageBootstrap extends LogManager {
- private static String[] args;
- private static ConfigurableApplicationContext context;
- public static void main(String[] args) {
- VManageBootstrap.args = args;
- VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
- }
- // 椤圭洰閲嶅惎
- public static void restart() {
- context.close();
- VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
- }
-
-
-}
+package com.genersoft.iot.vmp;
+
+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.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;
+
+/**
+ * 鍚姩绫�
+ */
+@ServletComponentScan("com.genersoft.iot.vmp.conf")
+@SpringBootApplication
+@EnableScheduling
+public class VManageBootstrap extends SpringBootServletInitializer {
+
+ private final static Logger logger = LoggerFactory.getLogger(VManageBootstrap.class);
+
+ private static String[] args;
+ private static ConfigurableApplicationContext context;
+ public static void main(String[] args) {
+ VManageBootstrap.args = args;
+ VManageBootstrap.context = SpringApplication.run(VManageBootstrap.class, args);
+ GitUtil gitUtil1 = SpringBeanFactory.getBean("gitUtil");
+ logger.info("鏋勫缓鐗堟湰锛� {}", gitUtil1.getBuildVersion());
+ logger.info("鏋勫缓鏃堕棿锛� {}", gitUtil1.getBuildDate());
+ logger.info("GIT鏈�鍚庢彁浜ゆ椂闂达細 {}", gitUtil1.getCommitTime());
+ }
+ // 椤圭洰閲嶅惎
+ public static void restart() {
+ 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