Skip to content

Commit 4124897

Browse files
committed
优化aop拦截规则
1 parent 5091e26 commit 4124897

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

hsweb-authorization/hsweb-authorization-shiro/src/main/java/org/hswebframework/web/authorization/shiro/ShiroAutoconfiguration.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,16 @@ public MethodInterceptorHolderAdvisor methodInterceptorHolderAdvisor() {
182182
@Aspect
183183
@Order(Ordered.HIGHEST_PRECEDENCE)
184184
static class MethodInterceptorHolderAdvisor {
185-
@Around(value = "@annotation(org.hswebframework.web.authorization.annotation.RequiresExpression)" +
186-
"||@annotation(org.hswebframework.web.authorization.annotation.RequiresDataAccess)" +
187-
"||@annotation(org.hswebframework.web.authorization.annotation.Authorize)" +
188-
"||within(@org.hswebframework.web.authorization.annotation.Authorize *)")
185+
@Around(value = "@annotation(org.hswebframework.web.authorization.annotation.RequiresExpression)"
186+
+ "||@annotation(org.hswebframework.web.authorization.annotation.RequiresDataAccess)"
187+
+ "||@annotation(org.hswebframework.web.authorization.annotation.Authorize)"
188+
+ "||("
189+
+ "within(@org.hswebframework.web.authorization.annotation.Authorize *) "
190+
+ "&& ("
191+
+ "@annotation(org.springframework.web.bind.annotation.RequestMapping)||"
192+
+ "execution(org.hswebframework.web.controller.message.ResponseMessage *(..)"
193+
+ ")))"
194+
)
189195
public Object around(ProceedingJoinPoint pjp) throws Throwable {
190196
MethodSignature signature = (MethodSignature) pjp.getSignature();
191197
String methodName = AopUtils.getMethodBody(pjp);

0 commit comments

Comments
 (0)