mirror of
				https://github.com/continew-org/continew-starter.git
				synced 2025-10-31 10:57:15 +08:00 
			
		
		
		
	refactor(auth/satoken): JWT 配置支持启用/关闭
This commit is contained in:
		| @@ -87,6 +87,7 @@ public class SaTokenAutoConfiguration implements WebMvcConfigurer { | |||||||
|      */ |      */ | ||||||
|     @Bean |     @Bean | ||||||
|     @ConditionalOnMissingBean |     @ConditionalOnMissingBean | ||||||
|  |     @ConditionalOnProperty(prefix = "sa-token.extension", name = "enableJwt", havingValue = "true") | ||||||
|     public StpLogic stpLogic() { |     public StpLogic stpLogic() { | ||||||
|         return new StpLogicJwtForSimple(); |         return new StpLogicJwtForSimple(); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -34,6 +34,11 @@ public class SaTokenExtensionProperties { | |||||||
|      */ |      */ | ||||||
|     private boolean enabled = false; |     private boolean enabled = false; | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 启用 JWT | ||||||
|  |      */ | ||||||
|  |     private boolean enableJwt = false; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 持久层配置 |      * 持久层配置 | ||||||
|      */ |      */ | ||||||
| @@ -54,6 +59,14 @@ public class SaTokenExtensionProperties { | |||||||
|         this.enabled = enabled; |         this.enabled = enabled; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public boolean isEnableJwt() { | ||||||
|  |         return enableJwt; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void setEnableJwt(boolean enableJwt) { | ||||||
|  |         this.enableJwt = enableJwt; | ||||||
|  |     } | ||||||
|  |  | ||||||
|     public SaTokenDaoProperties getDao() { |     public SaTokenDaoProperties getDao() { | ||||||
|         return dao; |         return dao; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user