#
vincentlu
2025-02-10 80a82efcb42ba4b6f24768e780b1b3f51e3141f4
rsf-server/src/main/java/com/vincent/rsf/server/system/controller/AuthController.java
@@ -106,9 +106,9 @@
    }
    @OperationLog("Reset Password")
    @PostMapping("/auth/password")
    @PostMapping("/auth/reset/password")
    public R resetPassword(@RequestBody UpdatePasswordParam param) {
        if (Cools.isEmpty(param.getOldPassword(), param.getPassword())) {
        if (Cools.isEmpty(param.getOldPassword(), param.getNewPassword())) {
            return R.error("Parameters Cannot Be Empty");
        }
        Long userId = getLoginUserId();
@@ -116,15 +116,15 @@
            return R.error("Please Login First");
        }
        if (!userService.comparePassword(userService.getById(userId).getPassword(), param.getOldPassword())) {
            return R.error("The Origin Password Was Incorrect");
            return R.parse("408-The Current Password Was Incorrect");
        }
        User user = new User();
        user.setId(userId);
        user.setPassword(userService.encodePassword(param.getPassword()));
        user.setPassword(userService.encodePassword(param.getNewPassword()));
        if (userService.updateById(user)) {
            return R.ok("Update Success");
            return R.ok("Reset Password Success");
        }
        return R.error("Update Fail");
        return R.error("Reset Password Fail");
    }