1
13693261870
2024-09-10 4a24728338b869117a58c21dbd5544d1f1e782fd
se-modules/se-system/src/main/java/com/se/system/controller/SysProfileController.java
@@ -98,11 +98,13 @@
    @Log(title = "个人信息", businessType = BusinessType.UPDATE)
    @PutMapping("/updatePwd")
    public AjaxResult updatePwd(String oldPassword, String newPassword) throws Exception {
        if (enableEncrypt) {
            oldPassword = AesUtils.decrypt(oldPassword);
            newPassword = AesUtils.decrypt(newPassword);
        }
        String username = SecurityUtils.getUsername();
        SysUser user = userService.selectUserByUserName(username);
        if (enableEncrypt && !StringUtils.isEmpty(user.getPassword())) {
            user.setPassword(AesUtils.decrypt(user.getPassword()));
        }
        String password = user.getPassword();
        if (!SecurityUtils.matchesPassword(oldPassword, password)) {
            return error("修改密码失败,旧密码错误");