Parcourir la source

Merge branch 'hurx'

hurx il y a 3 semaines
Parent
commit
3e5ff7f9e4

+ 11 - 11
ruoyi-modules/ruoyi-customer/src/main/java/org/dromara/customer/service/impl/CustomerInfoServiceImpl.java

@@ -1202,14 +1202,14 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
     @Transactional(rollbackFor = Exception.class)
     public Boolean register(CustomerRegisterBo bo) {
         //先校验验证码是否正确
-//        String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + bo.getPurchasePhone());
-//        if (code == null) {
-//            throw new ServiceException("验证码已过期");
-//        }
-//
-//        if (!code.equals(bo.getCode())) {
-//            throw new ServiceException("验证码错误");
-//        }
+        String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + bo.getPurchasePhone());
+        if (code == null) {
+            throw new ServiceException("验证码已过期");
+        }
+
+        if (!code.equals(bo.getCode())) {
+            throw new ServiceException("验证码错误");
+        }
 
         //校验密码与确认密码是否一致
         if (!bo.getPassword().equals(bo.getConfirmPassword())) {
@@ -1398,9 +1398,9 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
 
         log.info("客户注册成功,客户ID:{},客户名称:{}", customerId, bo.getCustomerName());
 
-//        if (null != code) {
-//            RedisUtils.deleteObject(GlobalConstants.CAPTCHA_CODE_KEY + bo.getPurchasePhone());
-//        }
+        if (null != code) {
+            RedisUtils.deleteObject(GlobalConstants.CAPTCHA_CODE_KEY + bo.getPurchasePhone());
+        }
         return true;
     }