3 Commits

Author SHA1 Message Date
lizhipeng
3c5f031a27 Pre Merge pull request !408 from lizhipeng/develop_lizhipeng 2025-08-27 08:01:45 +00:00
RuoYi
e6a3415a71 优化代码 2025-08-27 16:01:28 +08:00
18437927219
ecc3e3d0a4 修改注释 2025-05-15 11:41:34 +08:00
6 changed files with 33 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ package com.ruoyi.common.core.exception.file;
import java.util.Arrays;
/**
* 文件上传异常类
* 文件上传无效扩展名异常类
*
* @author ruoyi
*/

View File

@@ -163,7 +163,7 @@ public class SysUserController extends BaseController
@PutMapping("/recordlogin")
public R<Boolean> recordlogin(@RequestBody SysUser sysUser)
{
return R.ok(userService.updateUserProfile(sysUser));
return R.ok(userService.updateLoginInfo(sysUser));
}
/**

View File

@@ -76,6 +76,14 @@ public interface SysUserMapper
*/
public int updateUserAvatar(@Param("userId") Long userId, @Param("avatar") String avatar);
/**
* 更新用户登录信息IP和登录时间
*
* @param user 用户信息
* @return 结果
*/
public int updateLoginInfo(SysUser user);
/**
* 重置用户密码
*

View File

@@ -161,6 +161,14 @@ public interface ISysUserService
*/
public boolean updateUserAvatar(Long userId, String avatar);
/**
* 更新用户登录信息IP和登录时间
*
* @param user 用户信息
* @return 结果
*/
public boolean updateLoginInfo(SysUser user);
/**
* 重置用户密码
*

View File

@@ -354,6 +354,17 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.updateUserAvatar(userId, avatar) > 0;
}
/**
* 更新用户登录信息IP和登录时间
*
* @param user 用户信息
* @return 结果
*/
public boolean updateLoginInfo(SysUser user)
{
return userMapper.updateLoginInfo(user) > 0;
}
/**
* 重置用户密码
*

View File

@@ -205,6 +205,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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>