|
@@ -79,16 +79,16 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper, AppUser> impl
|
79
|
// 校验验证码发送是否超过限制
|
79
|
// 校验验证码发送是否超过限制
|
80
|
String key = PatientConstant.ERM_APP_CAPTCHA_CODE + phoneNumber;
|
80
|
String key = PatientConstant.ERM_APP_CAPTCHA_CODE + phoneNumber;
|
81
|
String repeat = key + ":repeat";
|
81
|
String repeat = key + ":repeat";
|
82
|
- int repeatNum = 1;
|
|
|
|
|
82
|
+ int repeatNum = 1, timeout = 30;
|
83
|
if (redisCache.hasKey(repeat)) {
|
83
|
if (redisCache.hasKey(repeat)) {
|
84
|
repeatNum = redisCache.getCacheObject(repeat);
|
84
|
repeatNum = redisCache.getCacheObject(repeat);
|
85
|
int num = maxRetryCount;
|
85
|
int num = maxRetryCount;
|
86
|
if (repeatNum >= num) {
|
86
|
if (repeatNum >= num) {
|
87
|
- return AjaxResult.error("验证码发送次数超过" + num + "次,请30分钟后再试");
|
|
|
|
|
87
|
+ return AjaxResult.error("验证码发送次数超过" + num + "次,请" + timeout + "分钟后再试");
|
88
|
}
|
88
|
}
|
89
|
repeatNum++;
|
89
|
repeatNum++;
|
90
|
}
|
90
|
}
|
91
|
- redisCache.setCacheObject(repeat, repeatNum, 30, TimeUnit.MINUTES);
|
|
|
|
|
91
|
+ redisCache.setCacheObject(repeat, repeatNum, timeout, TimeUnit.MINUTES);
|
92
|
|
92
|
|
93
|
// 生成验证码
|
93
|
// 生成验证码
|
94
|
int captchaCode = PatientBaseUtil.getCaptchaCode();
|
94
|
int captchaCode = PatientBaseUtil.getCaptchaCode();
|