| | |
| | | msgCode);
|
| | | // 发送短信
|
| | | // 发送间隔2分钟内的采用阿里云短信发送
|
| | | if (StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | String cacheString = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(cacheString) || Integer.parseInt(cacheString) < 2) {
|
| | | TencentSMSUtil.sendSingleMsg(phone, msg);
|
| | | redisManager.cacheCommonString(key, "1", 120);
|
| | | redisManager.increase(key);
|
| | | redisManager.expire(key, 120);
|
| | | } else {
|
| | | redisManager.removeCommonString(key);
|
| | | // 发送阿里云短信
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("code", msgCode);
|
| | | AliyunSMSUtil.sendSingleMsg(phone, Constant.smsConfig.getAliyunLoginTemplatecode(), data.toString());
|
| | | }
|
| | | // 缓存
|