!4 权限认证出现问题

Merge pull request !4 from 李坤/master
This commit is contained in:
郝先瑞
2024-04-28 07:10:21 +00:00
committed by Gitee

View File

@@ -32,12 +32,12 @@ public class MyDataPermissionHandler implements DataPermissionHandler {
String methodName = mappedStatementId.substring(mappedStatementId.lastIndexOf(StringPool.DOT) + 1);
Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
if (method.getName().equals(methodName)) {
DataPermission annotation = method.getAnnotation(DataPermission.class);
// 如果没有注解或者是超级管理员,直接返回
if (annotation == null || SecurityUtils.isRoot()) {
if (annotation == null || SecurityUtils.isRoot() ) {
return where;
}
if (method.getName().equals(methodName) || (method.getName() + "_COUNT").equals(methodName)) {
return dataScopeFilter(annotation.deptAlias(), annotation.deptIdColumnName(), annotation.userAlias(), annotation.userIdColumnName(), where);
}
}