| | |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.lock.DistributedLock; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.ValidatorUtil; |
| | |
| | | throw new IllegalArgumentException("手机号格式错误"); |
| | | } |
| | | |
| | | String requestId = DistributedLock.getLockUUID(); |
| | | String key = this.getClass().getSimpleName() + reqJson.getString("tel"); |
| | | try { |
| | | DistributedLock.waitGetDistributedLock(key, requestId); |
| | | //校验是否有有效的验证码 |
| | | String smsCode = CommonCache.getValue(reqJson.getString("tel") + SendSmsFactory.VALIDATE_CODE); |
| | | |
| | |
| | | throw new IllegalArgumentException("请不要重复发送验证码"); |
| | | } |
| | | } |
| | | } finally { |
| | | //清理事务信息 |
| | | DistributedLock.releaseDistributedLock(key, requestId); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |