自动配置类参数完善;日志表增加日志类型细化操作;增加预留字段比较新旧值数据存储;
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.config.web;
|
||||
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.alibaba.druid.support.http.StatViewServlet;
|
||||
import com.alibaba.druid.support.http.WebStatFilter;
|
||||
|
||||
/**
|
||||
* Servlet 配置
|
||||
* @author ThinkGem
|
||||
* @version 2017年11月30日
|
||||
*/
|
||||
@Configuration
|
||||
public class DruidStatConfig {
|
||||
|
||||
/**
|
||||
* 注册DruidFilter拦截
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean duridFilter() {
|
||||
FilterRegistrationBean bean = new FilterRegistrationBean();
|
||||
bean.setFilter(new WebStatFilter());
|
||||
bean.addInitParameter("exclusions", "*.css,*.js,*.png,"
|
||||
+ "*.jpg,*.gif,*.jpeg,*.bmp,*.ico,*.swf,*.psd,*.htc,*.htm,*.html,"
|
||||
+ "*.crx,*.xpi,*.exe,*.ipa,*.apk,*.otf,*.eot,*.svg,*.ttf,*.woff,"
|
||||
+ "/druid/*");
|
||||
bean.addUrlPatterns("/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册DruidServlet
|
||||
*/
|
||||
@Bean
|
||||
public ServletRegistrationBean druidServlet() {
|
||||
ServletRegistrationBean bean = new ServletRegistrationBean();
|
||||
bean.setServlet(new StatViewServlet());
|
||||
bean.addUrlMappings("/druid/*");
|
||||
return bean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.config.web.interceptor;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.sys.interceptor.LogInterceptor;
|
||||
|
||||
/**
|
||||
* 后台管理日志记录拦截器
|
||||
* @author ThinkGem
|
||||
* @version 2018年1月10日
|
||||
*/
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.log.enabled", havingValue="true", matchIfMissing=true)
|
||||
public class LogInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LogInterceptor())
|
||||
.addPathPatterns(Global.getAdminPath() + "/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/index")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/login")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/**/listData")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/**/treeData")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/file/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/tags/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/sys/log/**")
|
||||
.excludePathPatterns(Global.getAdminPath() + "/sys/online/count")
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
*/
|
||||
package com.jeesite.modules.config.web.interceptor;
|
||||
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.modules.sys.interceptor.LogInterceptor;
|
||||
|
||||
/**
|
||||
* 前台自动切换到手机视图拦截器
|
||||
* @author ThinkGem
|
||||
* @version 2018年1月10日
|
||||
*/
|
||||
@Configuration
|
||||
@EnableWebMvc
|
||||
@ConditionalOnProperty(name="web.interceptor.mobile.enabled", havingValue="true")
|
||||
public class MobileViewInterceptorConfig extends WebMvcConfigurerAdapter {
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new LogInterceptor())
|
||||
.addPathPatterns(Global.getFrontPath() + "/**")
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user