Explorar o código

优化 添加家庭成员时 验证码判断

java110 %!s(int64=6) %!d(string=hai) anos
pai
achega
39d52b7a9e

+ 1 - 1
Api/src/main/java/com/java110/api/listener/owner/ListAppUserBindingOwnersListener.java

@@ -150,7 +150,7 @@ public class ListAppUserBindingOwnersListener extends AbstractServiceApiListener
     }
 
     /**
-     * 获取批量userId
+     * 获取批量userIdsaveOwner
      *
      * @param auditAppUserBindingOwners 业主绑定信息
      * @return 批量userIds 信息

+ 16 - 0
Api/src/main/java/com/java110/api/listener/owner/SaveOwnerListener.java

@@ -4,10 +4,12 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.api.bmo.owner.IOwnerBMO;
 import com.java110.api.listener.AbstractServiceApiDataFlowListener;
+import com.java110.core.smo.common.ISmsInnerServiceSMO;
 import com.java110.core.smo.fee.IFeeConfigInnerServiceSMO;
 import com.java110.core.smo.file.IFileInnerServiceSMO;
 import com.java110.dto.fee.FeeConfigDto;
 import com.java110.dto.file.FileDto;
+import com.java110.dto.msg.SmsDto;
 import com.java110.utils.cache.MappingCache;
 import com.java110.utils.constant.*;
 import com.java110.utils.exception.ListenerExecuteException;
@@ -45,6 +47,9 @@ public class SaveOwnerListener extends AbstractServiceApiDataFlowListener {
     @Autowired
     private IOwnerBMO ownerBMOImpl;
 
+    @Autowired
+    private ISmsInnerServiceSMO smsInnerServiceSMOImpl;
+
     @Autowired
     private IFileInnerServiceSMO fileInnerServiceSMOImpl;
 
@@ -175,6 +180,17 @@ public class SaveOwnerListener extends AbstractServiceApiDataFlowListener {
             Assert.hasLength(paramObj.getString("state"), "state不能为空");
             Assert.hasLength(paramObj.getString("storeId"), "storeId不能为空");
         }
+
+        if(paramObj.containsKey("msgCode")){
+            SmsDto smsDto = new SmsDto();
+            smsDto.setTel(paramObj.getString("link"));
+            smsDto.setCode(paramObj.getString("msgCode"));
+            smsDto = smsInnerServiceSMOImpl.validateCode(smsDto);
+
+            if (!smsDto.isSuccess() && "ON".equals(MappingCache.getValue("APP_USER_BINDING_OWNER_SMS"))) {
+                throw new IllegalArgumentException(smsDto.getMsg());
+            }
+        }
     }