From b7abcd8374dfdd7bc35fdca527e58217195c7d6a Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 28 Nov 2023 13:07:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83/=E5=9F=BA=E6=9C=AC=E8=B5=84=E6=96=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=97=B6=E6=95=B0=E6=8D=AE=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysProfileController.java | 9 ++++--- .../views/system/user/profile/userInfo.vue | 25 ++++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java index 2ed35820d..3437c2d5f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java @@ -73,11 +73,11 @@ public class SysProfileController extends BaseController currentUser.setSex(user.getSex()); if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) { - return error("修改用户'" + user.getUserName() + "'失败,手机号码已存在"); + return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); } if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) { - return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在"); + return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在"); } if (userService.updateUserProfile(currentUser) > 0) { @@ -106,11 +106,12 @@ public class SysProfileController extends BaseController { return error("新密码不能与旧密码相同"); } - if (userService.resetUserPwd(username, SecurityUtils.encryptPassword(newPassword)) > 0) + newPassword = SecurityUtils.encryptPassword(newPassword); + if (userService.resetUserPwd(username, newPassword) > 0) { // 更新缓存用户密码 LoginUser loginUser = SecurityUtils.getLoginUser(); - loginUser.getSysUser().setPassword(SecurityUtils.encryptPassword(newPassword)); + loginUser.getSysUser().setPassword(newPassword); tokenService.setLoginUser(loginUser); return success(); } diff --git a/ruoyi-ui/src/views/system/user/profile/userInfo.vue b/ruoyi-ui/src/views/system/user/profile/userInfo.vue index a40d8f60f..df3345992 100644 --- a/ruoyi-ui/src/views/system/user/profile/userInfo.vue +++ b/ruoyi-ui/src/views/system/user/profile/userInfo.vue @@ -1,16 +1,16 @@