mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-09-04 11:50:59 +00:00
记录用户登录IP地址和登录时间
This commit is contained in:
@@ -79,7 +79,7 @@ public class SysProfileController extends BaseController
|
||||
{
|
||||
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
if (userService.updateUserProfile(currentUser) > 0)
|
||||
if (userService.updateUserProfile(currentUser))
|
||||
{
|
||||
// 更新缓存用户信息
|
||||
tokenService.setLoginUser(loginUser);
|
||||
|
@@ -149,6 +149,15 @@ public class SysUserController extends BaseController
|
||||
return R.ok(userService.registerUser(sysUser));
|
||||
}
|
||||
|
||||
/**
|
||||
*记录用户登录IP地址和登录时间
|
||||
*/
|
||||
@PutMapping("/recordlogin")
|
||||
public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
|
||||
{
|
||||
return R.ok(userService.updateUserProfile(sysUser));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
|
@@ -150,7 +150,7 @@ public interface ISysUserService
|
||||
* @param user 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateUserProfile(SysUser user);
|
||||
public boolean updateUserProfile(SysUser user);
|
||||
|
||||
/**
|
||||
* 修改用户头像
|
||||
|
@@ -336,9 +336,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserProfile(SysUser user)
|
||||
public boolean updateUserProfile(SysUser user)
|
||||
{
|
||||
return userMapper.updateUser(user);
|
||||
return userMapper.updateUser(user) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user