mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
废弃 SaTokenAction 接口,新增 SaStrategy 策略类
This commit is contained in:
@@ -13,6 +13,7 @@ import cn.dev33.satoken.oauth2.model.CodeModel;
|
||||
import cn.dev33.satoken.oauth2.model.RefreshTokenModel;
|
||||
import cn.dev33.satoken.oauth2.model.RequestAuthModel;
|
||||
import cn.dev33.satoken.oauth2.model.SaClientModel;
|
||||
import cn.dev33.satoken.strategy.SaStrategy;
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
|
||||
/**
|
||||
@@ -358,7 +359,7 @@ public class SaOAuth2Template {
|
||||
|
||||
// 3、是否在[允许地址列表]之中
|
||||
List<String> allowList = SaFoxUtil.convertStringToList(checkClientModel(clientId).allowUrl);
|
||||
if(SaManager.getSaTokenAction().hasElement(allowList, url) == false) {
|
||||
if(SaStrategy.me.hasElement.apply(allowList, url) == false) {
|
||||
throw new SaOAuth2Exception("非法redirect_url:" + url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import cn.dev33.satoken.SaManager;
|
||||
import cn.dev33.satoken.strategy.SaStrategy;
|
||||
import cn.dev33.satoken.util.SaTokenConsts;
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ public class SaCheckAspect {
|
||||
|
||||
// 注解鉴权
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
SaManager.getSaTokenAction().checkMethodAnnotation(signature.getMethod());
|
||||
SaStrategy.me.checkMethodAnnotation.accept(signature.getMethod());
|
||||
|
||||
try {
|
||||
// 执行原有逻辑
|
||||
|
||||
Reference in New Issue
Block a user