From 4adad521e6464025402639d0c2f7602610d15a67 Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期四, 07 十一月 2024 09:21:43 +0800 Subject: [PATCH] 错题展示 --- src/main/java/com/ycl/jxkg/service/impl/ClassesUserServiceImpl.java | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ycl/jxkg/service/impl/ClassesUserServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/ClassesUserServiceImpl.java index 909cc65..c2f488b 100644 --- a/src/main/java/com/ycl/jxkg/service/impl/ClassesUserServiceImpl.java +++ b/src/main/java/com/ycl/jxkg/service/impl/ClassesUserServiceImpl.java @@ -75,11 +75,13 @@ user.setPhone(form.getPhone()); user.setRealName(form.getRealName()); user.setSex(form.getSex()); - DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd"); - try { - user.setBirthDay(fmt.parse(form.getBirthDay())); - } catch (ParseException e) { - throw new RuntimeException(e); + if (StringUtils.hasText(form.getBirthDay())) { + DateFormat fmt =new SimpleDateFormat("yyyy-MM-dd"); + try { + user.setBirthDay(fmt.parse(form.getBirthDay())); + } catch (ParseException e) { + throw new RuntimeException(e); + } } user.setLastUpdatePasswordTime(new Date()); userMapper.insert(user); -- Gitblit v1.8.0