Browse Source

优化yaml导出测试

dev-lhz
chenzhihang 1 year ago
parent
commit
2c73249a77
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java

+ 6
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/YamlUtils.java View File

@@ -115,6 +115,11 @@ public class YamlUtils {
} }


public static boolean isNumeric(String str) { public static boolean isNumeric(String str) {
return str.matches("-?\\\\d+(\\\\.\\\\d+)?"); // 匹配整数或小数,包括负数
try {
double num = Double.parseDouble(str);
return true;
} catch (NumberFormatException e) {
return false;
}
} }
} }

Loading…
Cancel
Save