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