Browse Source

关闭swagger

Levi.u 4 years ago
parent
commit
0b6af78163

+ 6 - 0
src/main/java/com/ebei/screen/common/config/Knife4jConfig.java

@@ -29,9 +29,12 @@ import java.net.InetAddress;
 @Import(BeanValidatorPluginsConfiguration.class)
 public class Knife4jConfig implements ApplicationListener<WebServerInitializedEvent> {
 
+    private boolean isOpen = false;
+
     @Bean(value = "videoMonitor")
     public Docket videoMonitor() {
         return new Docket(DocumentationType.SWAGGER_2)
+                .enable(isOpen)
                 .useDefaultResponseMessages(false)
                 .apiInfo(apiInfo())
                 .groupName("视频监控大屏")
@@ -45,6 +48,7 @@ public class Knife4jConfig implements ApplicationListener<WebServerInitializedEv
     @Bean(value = "yardSystem")
     public Docket yardSystem() {
         return new Docket(DocumentationType.SWAGGER_2)
+                .enable(isOpen)
                 .apiInfo(apiInfo())
                 .groupName("车场系统大屏")
                 .select()
@@ -56,6 +60,7 @@ public class Knife4jConfig implements ApplicationListener<WebServerInitializedEv
     @Bean(value = "ebaSystem")
     public Docket ebaSystem() {
         return new Docket(DocumentationType.SWAGGER_2)
+                .enable(isOpen)
                 .apiInfo(apiInfo())
                 .groupName("EBA系统大屏")
                 .select()
@@ -67,6 +72,7 @@ public class Knife4jConfig implements ApplicationListener<WebServerInitializedEv
     @Bean(value = "energyPlatform")
     public Docket energyPlatform() {
         return new Docket(DocumentationType.SWAGGER_2)
+                .enable(isOpen)
                 .apiInfo(apiInfo())
                 .groupName("能耗平台大屏")
                 .select()

+ 1 - 1
src/main/java/com/ebei/screen/common/config/auth/LoginInterceptor.java

@@ -19,7 +19,7 @@ public class LoginInterceptor implements HandlerInterceptor {
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
         log.info("===========begin 认证拦截器===========");
-        return true;
+        return false;
     }
 
 }