فهرست منبع

根据配置控制是否过滤

RuoYi 5 سال پیش
والد
کامیت
55a4bfe70c
5فایلهای تغییر یافته به همراه17 افزوده شده و 11 حذف شده
  1. 3 5
      bin/clean.bat
  2. 3 4
      bin/package.bat
  3. 1 1
      bin/run.bat
  4. 1 1
      ruoyi-admin/pom.xml
  5. 9 0
      ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java

+ 3 - 5
bin/clean.bat

@@ -1,14 +1,12 @@
 @echo off
 echo.
-echo [淇℃伅] 娓呯悊鐢熸垚璺�緞銆�
-echo.
-pause
+echo [信息] 清理生成路径。
 echo.
 
+%~d0
 cd %~dp0
-cd..
 
+cd ..
 call mvn clean
 
-cd bin
 pause

+ 3 - 4
bin/package.bat

@@ -1,13 +1,12 @@
 @echo off
 echo.
-echo [淇℃伅] 鎵撳寘宸ョ▼锛岀敓鎴恓ar鍖呮枃浠躲€�
-echo.
-pause
+echo [信息] 打包Web工程,生成war/jar包文件。
 echo.
 
+%~d0
 cd %~dp0
-cd..
 
+cd ..
 call mvn clean package -Dmaven.test.skip=true
 
 pause

+ 1 - 1
bin/run.bat

@@ -1,6 +1,6 @@
 @echo off
 echo.
-echo [信�] �行Web工程。
+echo [ĐĹϢ] ÔËĐĐWebą¤łĚˇŁ
 echo.
 
 cd %~dp0

+ 1 - 1
ruoyi-admin/pom.xml

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

+ 9 - 0
ruoyi-framework/src/main/java/com/ruoyi/framework/config/DruidConfig.java

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