提交 c13c4b91 authored 作者: Whispa's avatar Whispa

commit commit

上级 a26f7a85
...@@ -107,7 +107,12 @@ public class UserController extends Controller { ...@@ -107,7 +107,12 @@ public class UserController extends Controller {
* 验证码时效5分钟,如果用户连续发送3次请求,则提示用户:操作频繁,请15分钟后重试 * 验证码时效5分钟,如果用户连续发送3次请求,则提示用户:操作频繁,请15分钟后重试
*/ */
//先从缓存中获取用户的发送次数 //先从缓存中获取用户的发送次数
int sentCount = user.getSentCount(); Integer sentCount = user.getSentCount();
if( sentCount == null ){
user.setSentCount(3);
sentCount = 3;
}
System.err.println(sentCount); System.err.println(sentCount);
//用户请求次数小于3次,则正常发送验证码,并且有效期为5分钟 //用户请求次数小于3次,则正常发送验证码,并且有效期为5分钟
......
...@@ -194,7 +194,7 @@ public class TbCfUserInfo { ...@@ -194,7 +194,7 @@ public class TbCfUserInfo {
return invitation > 0; return invitation > 0;
} }
public int getSentCount() { public Integer getSentCount() {
return sentCount; return sentCount;
} }
...@@ -214,7 +214,7 @@ public class TbCfUserInfo { ...@@ -214,7 +214,7 @@ public class TbCfUserInfo {
return verificationCode; return verificationCode;
} }
public void setSentCount(int sentCount) { public void setSentCount(Integer sentCount) {
this.sentCount = sentCount; this.sentCount = sentCount;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论