根据配置控制是否过滤

master
RuoYi 6 years ago committed by Limy
parent 9f24e9502e
commit 0014386bf3

@ -1,14 +1,12 @@
@echo off @echo off
echo. echo.
echo [信息] 清理生成路径。 echo [信息] 清理生成路径。
echo.
pause
echo. echo.
%~d0
cd %~dp0 cd %~dp0
cd..
cd ..
call mvn clean call mvn clean
cd bin
pause pause

@ -1,13 +1,12 @@
@echo off @echo off
echo. echo.
echo [信息] 打包工程生成jar包文件。 echo [信息] 打包Web工程生成war/jar包文件。
echo.
pause
echo. echo.
%~d0
cd %~dp0 cd %~dp0
cd..
cd ..
call mvn clean package -Dmaven.test.skip=true call mvn clean package -Dmaven.test.skip=true
pause pause

@ -1,6 +1,6 @@
@echo off @echo off
echo. echo.
echo [信息] 运行Web工程。 echo [信息] 运行Web工程。
echo. echo.
cd %~dp0 cd %~dp0

@ -8,7 +8,7 @@
<version>3.3</version> <version>3.3</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>war</packaging>
<artifactId>ruoyi-admin</artifactId> <artifactId>ruoyi-admin</artifactId>
<description> <description>

@ -63,6 +63,7 @@ public class DruidConfig
*/ */
@SuppressWarnings({ "rawtypes", "unchecked" }) @SuppressWarnings({ "rawtypes", "unchecked" })
@Bean @Bean
@ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties)
{ {
// 获取web监控页面的参数 // 获取web监控页面的参数
@ -74,6 +75,10 @@ public class DruidConfig
// 创建filter进行过滤 // 创建filter进行过滤
Filter filter = new Filter() Filter filter = new Filter()
{ {
@Override
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException
{
}
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException throws IOException, ServletException
@ -88,6 +93,10 @@ public class DruidConfig
text = text.replaceAll("powered.*?shrek.wang</a>", ""); text = text.replaceAll("powered.*?shrek.wang</a>", "");
response.getWriter().write(text); response.getWriter().write(text);
} }
@Override
public void destroy()
{
}
}; };
FilterRegistrationBean registrationBean = new FilterRegistrationBean(); FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(filter); registrationBean.setFilter(filter);

Loading…
Cancel
Save