替换带代码里所有 fastjson 的内容,统一使用 jackson
不考虑使用 gson 的原因,是基本停止了维护
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package cn.iocoder.dashboard.framework.security.core;
|
||||
|
||||
import cn.iocoder.dashboard.common.enums.CommonStatusEnum;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
@@ -49,43 +49,43 @@ public class LoginUser implements UserDetails {
|
||||
private Integer status;
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public boolean isEnabled() {
|
||||
return CommonStatusEnum.ENABLE.getStatus().equals(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public boolean isAccountNonExpired() {
|
||||
return true; // 返回 true,不依赖 Spring Security 判断
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public boolean isAccountNonLocked() {
|
||||
return true; // 返回 true,不依赖 Spring Security 判断
|
||||
}
|
||||
|
||||
@Override
|
||||
@JSONField(serialize = false) // 避免序列化
|
||||
@JsonIgnore// 避免序列化
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true; // 返回 true,不依赖 Spring Security 判断
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user