| | |
| | | @PutMapping("/recordlogin")
|
| | | public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
|
| | | {
|
| | | return R.ok(userService.updateUserProfile(sysUser));
|
| | | return R.ok(userService.updateLoginInfo(sysUser));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public int updateUserAvatar(@Param("userId") Long userId, @Param("avatar") String avatar);
|
| | |
|
| | | /**
|
| | | * 更新用户登录信息(IP和登录时间)
|
| | | * |
| | | * @param user 用户信息
|
| | | * @return 结果
|
| | | */
|
| | | public int updateLoginInfo(SysUser user);
|
| | |
|
| | | /**
|
| | | * 重置用户密码
|
| | | *
|
| | | * @param userId 用户ID
|
| | |
| | | public boolean updateUserAvatar(Long userId, String avatar);
|
| | |
|
| | | /**
|
| | | * 更新用户登录信息(IP和登录时间)
|
| | | * |
| | | * @param user 用户信息
|
| | | * @return 结果
|
| | | */
|
| | | public boolean updateLoginInfo(SysUser user);
|
| | |
|
| | | /**
|
| | | * 重置用户密码
|
| | | *
|
| | | * @param user 用户信息
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 更新用户登录信息(IP和登录时间)
|
| | | * |
| | | * @param user 用户信息
|
| | | * @return 结果
|
| | | */
|
| | | public boolean updateLoginInfo(SysUser user)
|
| | | {
|
| | | return userMapper.updateLoginInfo(user) > 0;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 重置用户密码
|
| | | *
|
| | | * @param user 用户信息
|
| | |
| | | update sys_user set avatar = #{avatar} where user_id = #{userId}
|
| | | </update>
|
| | |
|
| | | <update id="updateLoginInfo" parameterType="SysUser">
|
| | | update sys_user set login_ip = #{loginIp}, login_date = #{loginDate} where user_id = #{userId}
|
| | | </update>
|
| | | |
| | | <update id="resetUserPwd" parameterType="SysUser">
|
| | | update sys_user set pwd_update_date = sysdate(), password = #{password} where user_id = #{userId}
|
| | | </update>
|