1
luodangjia
2025-01-21 68ee18438e99995d2d108cccb36e75f77ea96d76
ruoyi-modules/ruoyi-company/src/main/java/com/ruoyi/company/controller/front/UserController.java
@@ -100,7 +100,7 @@
        if (!user.getPhone().equals(updatePhone.getOldPhone())) {
            return R.fail("旧手机号错误");
        }
        String verifyKey = CacheConstants.PHONE_CODE_KEY + StringUtils.nvl(user.getPhone(), "");
        String verifyKey = CacheConstants.PHONE_CODE_KEY + StringUtils.nvl(updatePhone.getNewPhone(), "");
        String captcha = redisService.getCacheObject(verifyKey);
        if (captcha == null) {
            throw new CaptchaException("验证码已失效");
@@ -127,8 +127,7 @@
    public R<Void> updatePassword(@RequestBody UpdatePassword updatePassword) {
        AppUser appLoginUser = SecurityUtils.getAppLoginUser();
        User user = userService.getById(appLoginUser.getUserId());
        String oldPassword = SecurityUtils.encryptPassword(updatePassword.getOldPassword());
        if (!user.getPassword().equals(oldPassword)) {
        if (!SecurityUtils.matchesPassword(updatePassword.getOldPassword(), user.getPassword())) {
            return R.fail("旧密码错误");
        }
        if (!updatePassword.getNewPassword().equals(updatePassword.getConfirmPassword())){