update 去除groups

feature/model
bleachtred 1 year ago
parent bfe1b2ae50
commit 977e9a119c

@ -6,7 +6,6 @@ import cn.hutool.core.io.FileUtil;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.file.MimeTypeUtils; import org.dromara.common.core.utils.file.MimeTypeUtils;
import org.dromara.common.core.validate.auth.PasswordGroup;
import org.dromara.common.log.annotation.Log; import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType; import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
@ -82,7 +81,7 @@ public class SysProfileController extends BaseController {
*/ */
@Log(title = "个人信息", businessType = BusinessType.UPDATE) @Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PutMapping("/updatePwd") @PutMapping("/updatePwd")
public R<Void> updatePwd(@Validated(PasswordGroup.class) @RequestBody SysUserPasswordBo bo) { public R<Void> updatePwd(@Validated @RequestBody SysUserPasswordBo bo) {
SysUserVo user = userService.selectUserById(LoginHelper.getUserId()); SysUserVo user = userService.selectUserById(LoginHelper.getUserId());
String password = user.getPassword(); String password = user.getPassword();
if (!BCrypt.checkpw(bo.getOldPassword(), password)) { if (!BCrypt.checkpw(bo.getOldPassword(), password)) {

@ -2,7 +2,6 @@ package org.dromara.system.domain.bo;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import org.dromara.common.core.validate.auth.PasswordGroup;
import java.io.Serial; import java.io.Serial;
import java.io.Serializable; import java.io.Serializable;
@ -19,12 +18,12 @@ public class SysUserPasswordBo implements Serializable {
/** /**
* *
*/ */
@NotBlank(message = "旧密码不能为空", groups = { PasswordGroup.class }) @NotBlank(message = "旧密码不能为空")
private String oldPassword; private String oldPassword;
/** /**
* *
*/ */
@NotBlank(message = "新密码不能为空", groups = { PasswordGroup.class }) @NotBlank(message = "新密码不能为空")
private String newPassword; private String newPassword;
} }

Loading…
Cancel
Save