libo 4 lat temu
rodzic
commit
945d48bfad

+ 10 - 6
src/main/java/com/tdba/cxb/ares/api/service/UserService.java

@@ -347,9 +347,9 @@ public class UserService {
347
      * @return
347
      * @return
348
      */
348
      */
349
     public UserLoginResp login(OperatorLoginReq param){
349
     public UserLoginResp login(OperatorLoginReq param){
350
-//        if(!param.getCode().equals("" + stringRedisTemplate.opsForValue().get("api.auth.sms." + param.getPhone()))){
351
-//            throw new TDBAException("短信验证码有误");
352
-//        }
350
+        if(!param.getCode().equals("" + stringRedisTemplate.opsForValue().get("api.auth.sms." + param.getPhone()))){
351
+            throw new TDBAException("短信验证码有误");
352
+        }
353
         redisTemplate.delete("api.auth.sms." + param.getPhone());
353
         redisTemplate.delete("api.auth.sms." + param.getPhone());
354
 
354
 
355
         UserVo userVo = userMapper.selectByAccount(param.getPhone());
355
         UserVo userVo = userMapper.selectByAccount(param.getPhone());
@@ -387,9 +387,9 @@ public class UserService {
387
      */
387
      */
388
     @Transactional
388
     @Transactional
389
     public void teamAdd(BindUserAdd param, BaseUser baseUser){
389
     public void teamAdd(BindUserAdd param, BaseUser baseUser){
390
-//        if(!param.getCode().equals("" + stringRedisTemplate.opsForValue().get("api.auth.sms." + param.getMobile()))){
391
-//            throw new TDBAException("短信验证码有误");
392
-//        }
390
+        if(!param.getCode().equals("" + stringRedisTemplate.opsForValue().get("api.auth.sms." + param.getPhone()))){
391
+            throw new TDBAException("短信验证码有误");
392
+        }
393
         redisTemplate.delete("api.auth.sms." + param.getPhone());
393
         redisTemplate.delete("api.auth.sms." + param.getPhone());
394
 
394
 
395
         UserVo userVo = userMapper.selectByAccountForSimple(param.getPhone());
395
         UserVo userVo = userMapper.selectByAccountForSimple(param.getPhone());
@@ -405,6 +405,10 @@ public class UserService {
405
         }
405
         }
406
 
406
 
407
         List<Integer> oldUidList = userBindMapper.selectUid(baseUser.getId());
407
         List<Integer> oldUidList = userBindMapper.selectUid(baseUser.getId());
408
+        if(oldUidList.size() >= 20){
409
+            throw new TDBAException("团队成员个数不能超过20");
410
+        }
411
+
408
         boolean isFilter = false;
412
         boolean isFilter = false;
409
         if(!oldUidList.isEmpty()){
413
         if(!oldUidList.isEmpty()){
410
             if(0 < userRelateMapper.countByUid(userVo.getId(), oldUidList)){
414
             if(0 < userRelateMapper.countByUid(userVo.getId(), oldUidList)){