Skip to content

Commit

Permalink
fix[litemall-wx-api]: 账号登录时更新登录时间和IP地址
Browse files Browse the repository at this point in the history
  • Loading branch information
linlinjava committed Jun 12, 2019
1 parent 11587af commit bdf1618
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ public Object login(@RequestBody String body, HttpServletRequest request) {
return ResponseUtil.fail(AUTH_INVALID_ACCOUNT, "账号密码不对");
}

// 更新登录情况
user.setLastLoginTime(LocalDateTime.now());
user.setLastLoginIp(IpUtil.getIpAddr(request));
if (userService.updateById(user) == 0) {
return ResponseUtil.updatedDataFailed();
}

// userInfo
UserInfo userInfo = new UserInfo();
userInfo.setNickName(username);
Expand Down

0 comments on commit bdf1618

Please sign in to comment.