sa-token-solon-plugin: 升级 solon 为 2.1.0

This commit is contained in:
noear
2023-02-09 22:12:15 +08:00
parent ed74fc709a
commit d173b2b406
7 changed files with 9 additions and 20 deletions

View File

@@ -42,21 +42,9 @@ public class XPluginImp implements Plugin {
//注入其它 Bean
context.beanOnloaded(c -> {
beanInitDo(c);
ssoBeanInitDo(c);
oauth2BeanInitDo(c);
});
}
private void ssoBeanInitDo(AopContext context){
if (Utils.loadClass("cn.dev33.satoken.sso.SaSsoManager") != null) {
context.beanMake(SaSsoAutoConfigure.class);
}
}
private void oauth2BeanInitDo(AopContext context){
if(Utils.loadClass("cn.dev33.satoken.oauth2.SaOAuth2Manager") != null){
context.beanMake(SaOAuth2AutoConfigure.class);
}
});
}
private void beanInitDo(AopContext context) {

View File

@@ -5,6 +5,7 @@ import cn.dev33.satoken.oauth2.config.SaOAuth2Config;
import cn.dev33.satoken.oauth2.logic.SaOAuth2Template;
import cn.dev33.satoken.oauth2.logic.SaOAuth2Util;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Condition;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
@@ -12,13 +13,14 @@ import org.noear.solon.annotation.Inject;
* @author noear
* @since 2.0
*/
@Condition(hasClass = SaOAuth2Manager.class)
@Configuration
public class SaOAuth2AutoConfigure {
/**
* 获取 OAuth2配置Bean
*/
@Bean
public SaOAuth2Config getConfig(@Inject(value = "${sa-token.oauth2}",required = false) SaOAuth2Config oAuth2Config) {
public SaOAuth2Config getConfig(@Inject(value = "${sa-token.oauth2}", required = false) SaOAuth2Config oAuth2Config) {
return oAuth2Config;
}

View File

@@ -6,14 +6,15 @@ import cn.dev33.satoken.sso.SaSsoProcessor;
import cn.dev33.satoken.sso.SaSsoTemplate;
import cn.dev33.satoken.sso.SaSsoUtil;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Condition;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
/**
* @author noear
* @since 2.0
*/
@Condition(hasClass = SaSsoManager.class)
@Configuration
public class SaSsoAutoConfigure {
/**