Commit 58e2301c by shenjunjie

权限部分调整4

parent 341f1d71
......@@ -2,7 +2,6 @@ package com.zhiwei.brandkbs2.auth;
import com.alibaba.fastjson.JSON;
import com.zhiwei.brandkbs2.common.GenericAttribute;
import com.zhiwei.brandkbs2.enmus.RoleEnum;
import com.zhiwei.brandkbs2.model.CommonCodeEnum;
import com.zhiwei.brandkbs2.model.ResponseResult;
import com.zhiwei.brandkbs2.pojo.UserInfo;
......@@ -56,18 +55,6 @@ public class AuthAspect {
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
ServletRequestAttributes servletRequestAttributes = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes());
HttpServletRequest request = servletRequestAttributes.getRequest();
Signature signature = joinPoint.getSignature();
Method method = ((MethodSignature) signature).getMethod();
Class<?> classTarget = joinPoint.getTarget().getClass();
// 优先使用方法权限
Auth auth = method.getAnnotation(Auth.class);
if (null == auth) {
auth = classTarget.getAnnotation(Auth.class);
}
// 不需要验证权限
if (null == auth || RoleEnum.NO_AUTHORISE == auth.role()) {
return joinPoint.proceed();
}
String token = request.getHeader(jwtKey);
// 存在有效token
if (null != token && !Tools.tokenEmpty(token)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment