mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-19 10:08:07 +08:00
sa-token-solon-plugin: 升级 solon 为 2.1.0
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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 {
|
||||
/**
|
||||
|
Reference in New Issue
Block a user