Commit 35d31a55 authored by tianbo's avatar tianbo

权限拦截器修改

parent e798ceaa
...@@ -76,15 +76,15 @@ public class PermissionInterceptor implements Interceptor { ...@@ -76,15 +76,15 @@ public class PermissionInterceptor implements Interceptor {
PermissionInterceptorContext.clean(); PermissionInterceptorContext.clean();
return invocation.proceed(); return invocation.proceed();
} }
if(!ValidationUtil.isEmpty(dataAuth)){
dataAuthRule = !ValidationUtil.isEmpty(dataAuthRule) ? dataAuthRule : dataAuth.interfacePath();
}
// 数据权限地址为空返回空数据 // 数据权限地址为空返回空数据
if (ValidationUtil.isEmpty(dataAuth.interfacePath()) && ValidationUtil.isEmpty(dataAuthRule)) { if(ValidationUtil.isEmpty(dataAuthRule)){
// method.getReturnType().isPrimitive() = true 是count语句 // method.getReturnType().isPrimitive() = true 是count语句
PermissionInterceptorContext.clean(); PermissionInterceptorContext.clean();
return method.getReturnType().isPrimitive() ? invocation.proceed() : null; return method.getReturnType().isPrimitive() ? invocation.proceed() : null;
} }
dataAuthRule = ValidationUtil.isEmpty(dataAuth.interfacePath()) ? dataAuthRule : dataAuth.interfacePath();
ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId() ReginParams reginParam = JSON.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId()
, RequestContext.getToken())).toString(), ReginParams.class); , RequestContext.getToken())).toString(), ReginParams.class);
if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) { if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) {
...@@ -363,4 +363,4 @@ public class PermissionInterceptor implements Interceptor { ...@@ -363,4 +363,4 @@ public class PermissionInterceptor implements Interceptor {
} }
return ruleValue; return ruleValue;
} }
} }
\ No newline at end of file
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