woody il y a 3 mois
Parent
commit
f1981b66d5

+ 5 - 5
framework-database/src/main/java/com/chelvc/framework/database/config/DatabaseProperties.java

@@ -24,11 +24,6 @@ public class DatabaseProperties {
      */
     @Data
     public static class Cache {
-        /**
-         * 是否启用缓存
-         */
-        private boolean enabled;
-
         /**
          * 缓存容量
          */
@@ -38,6 +33,11 @@ public class DatabaseProperties {
          * 缓存时间(秒)
          */
         private int duration = 60;
+
+        /**
+         * 是否启用缓存
+         */
+        private boolean enabled = false;
     }
 
     /**

+ 1 - 1
framework-feign/src/main/java/com/chelvc/framework/feign/config/FeignProperties.java

@@ -40,6 +40,6 @@ public class FeignProperties {
         /**
          * 是否增加接口前缀
          */
-        private boolean prefixed;
+        private boolean prefixed = false;
     }
 }

+ 2 - 0
framework-security/src/main/java/com/chelvc/framework/security/config/AuthorizeConfigurer.java

@@ -32,6 +32,7 @@ import org.springframework.aop.framework.AopProxyUtils;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.core.env.Environment;
@@ -68,6 +69,7 @@ import org.springframework.security.web.access.AccessDeniedHandler;
 @Slf4j
 @EnableWebSecurity
 @RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@ConditionalOnProperty(value = "security.authorize.enabled", havingValue = "true")
 public class AuthorizeConfigurer extends WebSecurityConfigurerAdapter {
     private final SecurityProperties properties;
     private final ApplicationContext applicationContext;

+ 11 - 6
framework-security/src/main/java/com/chelvc/framework/security/config/SecurityProperties.java

@@ -59,11 +59,6 @@ public class SecurityProperties {
      */
     @Data
     public static class Cache {
-        /**
-         * 是否启用缓存
-         */
-        private boolean enabled;
-
         /**
          * 缓存容量
          */
@@ -73,6 +68,11 @@ public class SecurityProperties {
          * 缓存时间(秒)
          */
         private int duration = 60;
+
+        /**
+         * 是否启用缓存
+         */
+        private boolean enabled = false;
     }
 
     /**
@@ -114,6 +114,11 @@ public class SecurityProperties {
         /**
          * 是否区分应用范围
          */
-        private boolean scoped;
+        private boolean scoped = false;
+
+        /**
+         * 是否启用认证
+         */
+        private boolean enabled = true;
     }
 }