From e6a3415a7182c0a5e64dd369a91ac5f2a6b7870d Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Wed, 27 Aug 2025 16:01:28 +0800
Subject: [PATCH] 优化代码
---
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
index 787fcce..e649fab 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -336,22 +336,33 @@
* @return 结果
*/
@Override
- public int updateUserProfile(SysUser user)
+ public boolean updateUserProfile(SysUser user)
{
- return userMapper.updateUser(user);
+ return userMapper.updateUser(user) > 0;
}
/**
* 修改用户头像
*
- * @param userName 用户名
+ * @param userId 用户ID
* @param avatar 头像地址
* @return 结果
*/
@Override
- public boolean updateUserAvatar(String userName, String avatar)
+ public boolean updateUserAvatar(Long userId, String avatar)
{
- return userMapper.updateUserAvatar(userName, avatar) > 0;
+ return userMapper.updateUserAvatar(userId, avatar) > 0;
+ }
+
+ /**
+ * 更新用户登录信息(IP和登录时间)
+ *
+ * @param user 用户信息
+ * @return 结果
+ */
+ public boolean updateLoginInfo(SysUser user)
+ {
+ return userMapper.updateLoginInfo(user) > 0;
}
/**
@@ -369,14 +380,14 @@
/**
* 重置用户密码
*
- * @param userName 用户名
+ * @param userId 用户ID
* @param password 密码
* @return 结果
*/
@Override
- public int resetUserPwd(String userName, String password)
+ public int resetUserPwd(Long userId, String password)
{
- return userMapper.resetUserPwd(userName, password);
+ return userMapper.resetUserPwd(userId, password);
}
/**
--
Gitblit v1.9.3