parent
36e28eb227
commit
2fddf4cfc1
|
|
@ -1 +1,2 @@
|
||||||
# boot-security
|
# boot-security
|
||||||
|
## 2018.03.05 spring boot 由1.5.10 升级到2.0.0
|
||||||
|
|
|
||||||
14
pom.xml
14
pom.xml
|
|
@ -8,17 +8,15 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.5.10.RELEASE</version>
|
<version>2.0.0.RELEASE</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<swagger.version>2.7.0</swagger.version>
|
<swagger.version>2.7.0</swagger.version>
|
||||||
<google.guava>23.0</google.guava>
|
<google.guava>23.0</google.guava>
|
||||||
<commons-lang3>3.7</commons-lang3>
|
|
||||||
<fastjson.version>1.2.41</fastjson.version>
|
<fastjson.version>1.2.41</fastjson.version>
|
||||||
<quartz.version>2.3.0</quartz.version>
|
<druid.version>1.1.8</druid.version>
|
||||||
<druid.version>1.1.6</druid.version>
|
|
||||||
<poi.version>3.17</poi.version>
|
<poi.version>3.17</poi.version>
|
||||||
<jwt.version>0.9.0</jwt.version>
|
<jwt.version>0.9.0</jwt.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
@ -45,7 +43,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>${commons-lang3}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId>
|
<!-- <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId>
|
||||||
</dependency> -->
|
</dependency> -->
|
||||||
|
|
@ -89,6 +86,12 @@
|
||||||
<artifactId>druid</artifactId>
|
<artifactId>druid</artifactId>
|
||||||
<version>${druid.version}</version>
|
<version>${druid.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- druid需要此日志包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.2.17</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
<artifactId>springfox-swagger2</artifactId>
|
<artifactId>springfox-swagger2</artifactId>
|
||||||
|
|
@ -115,7 +118,6 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
<groupId>org.quartz-scheduler</groupId>
|
||||||
<artifactId>quartz</artifactId>
|
<artifactId>quartz</artifactId>
|
||||||
<version>${quartz.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,10 @@ public class DruidConfig {
|
||||||
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ServletRegistrationBean druidServlet() {
|
public ServletRegistrationBean<StatViewServlet> druidServlet() {
|
||||||
log.info("init Druid Servlet Configuration ");
|
log.info("init Druid Servlet Configuration ");
|
||||||
ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(new StatViewServlet(),
|
ServletRegistrationBean<StatViewServlet> servletRegistrationBean = new ServletRegistrationBean<>(
|
||||||
"/druid/*");
|
new StatViewServlet(), "/druid/*");
|
||||||
// IP白名单
|
// IP白名单
|
||||||
servletRegistrationBean.addInitParameter("allow", "127.0.0.1");
|
servletRegistrationBean.addInitParameter("allow", "127.0.0.1");
|
||||||
// IP黑名单(共同存在时,deny优先于allow)
|
// IP黑名单(共同存在时,deny优先于allow)
|
||||||
|
|
@ -46,8 +46,9 @@ public class DruidConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public FilterRegistrationBean filterRegistrationBean() {
|
public FilterRegistrationBean<WebStatFilter> filterRegistrationBean() {
|
||||||
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter());
|
FilterRegistrationBean<WebStatFilter> filterRegistrationBean = new FilterRegistrationBean<>(
|
||||||
|
new WebStatFilter());
|
||||||
filterRegistrationBean.addUrlPatterns("/*");
|
filterRegistrationBean.addUrlPatterns("/*");
|
||||||
filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
|
filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*");
|
||||||
return filterRegistrationBean;
|
return filterRegistrationBean;
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,11 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
||||||
|
|
||||||
import com.boot.security.server.page.table.PageTableArgumentResolver;
|
import com.boot.security.server.page.table.PageTableArgumentResolver;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class WebMvcConfig extends WebMvcConfigurerAdapter {
|
public class WebMvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跨域支持
|
* 跨域支持
|
||||||
|
|
@ -25,7 +24,7 @@ public class WebMvcConfig extends WebMvcConfigurerAdapter {
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public WebMvcConfigurer corsConfigurer() {
|
public WebMvcConfigurer corsConfigurer() {
|
||||||
return new WebMvcConfigurerAdapter() {
|
return new WebMvcConfigurer() {
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/**").allowedMethods("*");
|
registry.addMapping("/**").allowedMethods("*");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue