Skip to content

Commit

Permalink
otale#10 修改密码输入第五次才进行提醒
Browse files Browse the repository at this point in the history
  • Loading branch information
nonacosa committed Feb 25, 2017
1 parent 14b257f commit ea54f4a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/tale/controller/admin/AuthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ public RestResponse doLogin(@QueryParam String username,

Integer error_count = cache.get("login_error_count");
try {
if(null != error_count && error_count >= 3){
return RestResponse.fail("您输入密码已经错误超过3次,请10分钟后尝试");
}
Users user = usersService.login(username, password);
session.attribute(TaleConst.LOGIN_SESSION_KEY, user);
if (StringKit.isNotBlank(remeber_me)) {
Expand All @@ -63,7 +60,9 @@ public RestResponse doLogin(@QueryParam String username,
} catch (Exception e) {
error_count = null == error_count ? 1 : error_count + 1;
cache.set("login_error_count", error_count, 10 * 60);

if(null != error_count && error_count > 3){
return RestResponse.fail("您输入密码已经错误超过3次,请10分钟后尝试");
}
String msg = "登录失败";
if (e instanceof TipException) {
msg = e.getMessage();
Expand Down

0 comments on commit ea54f4a

Please sign in to comment.