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

Merge pull request !222 from 西东/dev
This commit is contained in:
孔明 2023-02-09 14:14:16 +00:00 committed by Gitee
commit 3f761f7677
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 9 additions and 21 deletions

View File

@ -10,7 +10,7 @@
<!-- 定义 Sa-Token 版本号 -->
<properties>
<sa-token.version>1.34.0</sa-token.version>
<solon.version>1.12.4</solon.version>
<solon.version>2.1.0</solon.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

View File

@ -9,7 +9,7 @@
<!-- 定义 Sa-Token 版本号 -->
<properties>
<sa-token.version>1.34.0</sa-token.version>
<solon.version>1.12.4</solon.version>
<solon.version>2.1.0</solon.version>
</properties>
<dependencies>

View File

@ -23,7 +23,7 @@
<servlet-api.version>3.1.0</servlet-api.version>
<jakarta-servlet-api.version>6.0.0</jakarta-servlet-api.version>
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
<solon.version>1.12.4</solon.version>
<solon.version>2.1.0</solon.version>
<noear-redisx.version>1.4.5</noear-redisx.version>
<noear-snack3.version>3.2.50</noear-snack3.version>
<jfinal.version>4.9.17</jfinal.version>

View File

@ -1,7 +1,6 @@
package cn.dev33.satoken.dao;
import org.noear.redisx.RedisClient;
import org.noear.solon.annotation.Note;
import java.util.Properties;
@ -11,7 +10,6 @@ import java.util.Properties;
* @author noear
* @since 1.6
*/
@Note("更名为SaTokenDaoOfRedisBase64")
@Deprecated
public class SaTokenDaoOfRedis extends SaTokenDaoOfRedisBase64 {

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,15 +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.Init;
import org.noear.solon.annotation.Inject;
import org.noear.solon.core.AopContext;
/**
* @author noear
* @since 2.0
*/
@Condition(hasClass = SaSsoManager.class)
@Configuration
public class SaSsoAutoConfigure {
/**