mirror of
https://gitee.com/y_project/RuoYi-Vue.git
synced 2025-12-08 06:52:29 +08:00
忽略用户密码字段的JSON序列化
This commit is contained in:
@ -96,7 +96,8 @@ public class SysProfileController extends BaseController
|
||||
String newPassword = params.get("newPassword");
|
||||
LoginUser loginUser = getLoginUser();
|
||||
Long userId = loginUser.getUserId();
|
||||
String password = loginUser.getPassword();
|
||||
SysUser user = userService.selectUserById(userId);
|
||||
String password = user.getPassword();
|
||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
||||
{
|
||||
return error("修改密码失败,旧密码错误");
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.annotation.Excel.ColumnType;
|
||||
import com.ruoyi.common.annotation.Excel.Type;
|
||||
@ -200,6 +201,7 @@ public class SysUser extends BaseEntity
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
|
||||
Reference in New Issue
Block a user