Commit 35d31a55 authored by tianbo's avatar tianbo

权限拦截器修改

parent e798ceaa
......@@ -76,15 +76,15 @@ public class PermissionInterceptor implements Interceptor {
PermissionInterceptorContext.clean();
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语句
PermissionInterceptorContext.clean();
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()
, RequestContext.getToken())).toString(), ReginParams.class);
if (ValidationUtil.isEmpty(reginParam) || ValidationUtil.isEmpty(reginParam.getUserModel())) {
......@@ -363,4 +363,4 @@ public class PermissionInterceptor implements Interceptor {
}
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