提交 cbe582a1 authored 作者: 马晨俊's avatar 马晨俊

mcj:user非空判断

上级 e26c2cb3
......@@ -44,6 +44,7 @@ public class AopIntercept {
public Object aroundMethod(ProceedingJoinPoint joinPoint) throws Throwable {
AuthAnnotation authAnnotation = ((MethodSignature)joinPoint.getSignature()).getMethod().getAnnotation(AuthAnnotation.class);
String[] code = authAnnotation.code();
if(user!=null){
List<String> authorityCode = user.getAuthorityCode();
for (String s : code) {
if (authorityCode.contains(s)) {
......@@ -60,6 +61,7 @@ public class AopIntercept {
return proceed;
}
}
}
return ResponseEntity.status(403).build();
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论