登录成功信息更新优化
This commit is contained in:
+3
-1
@@ -160,7 +160,9 @@ public abstract class AbstractAuthenticationRealm {
|
|||||||
}
|
}
|
||||||
historyLoginService.login(historyLogin);
|
historyLoginService.login(historyLogin);
|
||||||
|
|
||||||
loginService.updateLastLogin(userInfo);
|
if(WebConstants.LOGIN_RESULT.SUCCESS.equalsIgnoreCase(message)) {
|
||||||
|
loginService.updateLastLogin(userInfo);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-3
@@ -52,7 +52,7 @@ import org.springframework.stereotype.Repository;
|
|||||||
public class LoginServiceImpl implements LoginService{
|
public class LoginServiceImpl implements LoginService{
|
||||||
private static final Logger _logger = LoggerFactory.getLogger(LoginServiceImpl.class);
|
private static final Logger _logger = LoggerFactory.getLogger(LoginServiceImpl.class);
|
||||||
|
|
||||||
private static final String LOGIN_USERINFO_UPDATE_STATEMENT = "update mxk_userinfo set lastlogintime = ? , lastloginip = ? , logincount = ?, online = "
|
private static final String LOGIN_USERINFO_UPDATE_STATEMENT = "update mxk_userinfo set badpasswordcount = 0 , logincount = logincount + 1 , lastlogintime = ? , lastloginip = ? , online = "
|
||||||
+ UserInfo.ONLINE.ONLINE + " where id = ?";
|
+ UserInfo.ONLINE.ONLINE + " where id = ?";
|
||||||
|
|
||||||
private static final String GROUPS_SELECT_STATEMENT = "select distinct g.id,g.groupcode,g.groupname from mxk_userinfo u,mxk_groups g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id ";
|
private static final String GROUPS_SELECT_STATEMENT = "select distinct g.id,g.groupcode,g.groupname from mxk_userinfo u,mxk_groups g,mxk_group_member gm where u.id = ? and u.id=gm.memberid and gm.groupid=g.id ";
|
||||||
@@ -369,10 +369,9 @@ public class LoginServiceImpl implements LoginService{
|
|||||||
new Object[] {
|
new Object[] {
|
||||||
userInfo.getLastLoginTime(),
|
userInfo.getLastLoginTime(),
|
||||||
userInfo.getLastLoginIp(),
|
userInfo.getLastLoginIp(),
|
||||||
userInfo.getLoginCount() + 1,
|
|
||||||
userInfo.getId()
|
userInfo.getId()
|
||||||
},
|
},
|
||||||
new int[] { Types.TIMESTAMP, Types.VARCHAR, Types.INTEGER, Types.VARCHAR });
|
new int[] { Types.TIMESTAMP, Types.VARCHAR, Types.VARCHAR });
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserInfoRowMapper implements RowMapper<UserInfo> {
|
public class UserInfoRowMapper implements RowMapper<UserInfo> {
|
||||||
|
|||||||
Reference in New Issue
Block a user