|
@@ -6,11 +6,17 @@ import com.jiayue.ssi.interceptor.TokenStatusInterceptor;
|
|
import com.jiayue.ssi.service.SysBlacklistService;
|
|
import com.jiayue.ssi.service.SysBlacklistService;
|
|
import com.jiayue.ssi.service.SysParameterService;
|
|
import com.jiayue.ssi.service.SysParameterService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.boot.web.servlet.ServletContextInitializer;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Bean;
|
|
import org.springframework.context.annotation.Configuration;
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
+import org.springframework.security.web.firewall.HttpFirewall;
|
|
|
|
+import org.springframework.security.web.firewall.StrictHttpFirewall;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
|
|
+import javax.servlet.ServletContext;
|
|
|
|
+import javax.servlet.ServletException;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -53,4 +59,15 @@ public class WebConfig implements WebMvcConfigurer {
|
|
CacheConstants.blacklistMap.put(sysBlacklist.getIp(),sysBlacklist);
|
|
CacheConstants.blacklistMap.put(sysBlacklist.getIp(),sysBlacklist);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Bean
|
|
|
|
+ public ServletContextInitializer servletContextInitializer() {
|
|
|
|
+ return new ServletContextInitializer() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onStartup(ServletContext servletContext) throws ServletException {
|
|
|
|
+ // 解决加密会话(SSL)Cookie 中缺少 Secure 属性
|
|
|
|
+ servletContext.getSessionCookieConfig().setSecure(true);
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ }
|
|
}
|
|
}
|