xujunwei před 4 roky
rodič
revize
e8d3f95558

+ 6 - 2
framework-common/src/main/java/com/mrxu/framework/common/util/DateFunc.java

@@ -409,9 +409,13 @@ public class DateFunc {
      * @throws ParseException 解析异常
      * @return 结果
      */
-    public static Date getDate(String date, String format) throws ParseException {
+    public static Date getDate(String date, String format) {
         SimpleDateFormat sd = new SimpleDateFormat(format);
-        return sd.parse(date);
+        try {
+            return sd.parse(date);
+        } catch (ParseException e) {
+            throw new BusinessException("日期格式错误");
+        }
     }
 
     /**