Sfoglia il codice sorgente

fix 修复 一些不正常类无法加载报错问题

疯狂的狮子Li 11 mesi fa
parent
commit
102d854743

+ 6 - 1
ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/handler/PlusDataPermissionHandler.java

@@ -149,7 +149,12 @@ public class PlusDataPermissionHandler {
         int index = sb.lastIndexOf(".");
         String clazzName = sb.substring(0, index);
         String methodName = sb.substring(index + 1, sb.length());
-        Class<?> clazz = ClassUtil.loadClass(clazzName);
+        Class<?> clazz;
+        try {
+            clazz = ClassUtil.loadClass(clazzName);
+        } catch (Exception e) {
+            return null;
+        }
         List<Method> methods = Arrays.stream(ClassUtil.getDeclaredMethods(clazz))
             .filter(method -> method.getName().equals(methodName)).toList();
         DataPermission dataPermission;