Просмотр исходного кода

字符未使用下划线不进行驼峰式处理

RuoYi лет назад: 3
Родитель
Сommit
8eb22e86e0

+ 6 - 1
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/StringUtils.java

@@ -428,7 +428,8 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
428
     }
428
     }
429
 
429
 
430
     /**
430
     /**
431
-     * 驼峰式命名法 例如:user_name->userName
431
+     * 驼峰式命名法
432
+     * 例如:user_name->userName
432
      */
433
      */
433
     public static String toCamelCase(String s)
434
     public static String toCamelCase(String s)
434
     {
435
     {
@@ -436,6 +437,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
436
         {
437
         {
437
             return null;
438
             return null;
438
         }
439
         }
440
+        if (s.indexOf(SEPARATOR) == -1)
441
+        {
442
+            return s;
443
+        }
439
         s = s.toLowerCase();
444
         s = s.toLowerCase();
440
         StringBuilder sb = new StringBuilder(s.length());
445
         StringBuilder sb = new StringBuilder(s.length());
441
         boolean upperCase = false;
446
         boolean upperCase = false;