mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-22 12:48:59 +08:00
fix: 刷新模式反序列化字段缺失报错问题修复
This commit is contained in:
parent
4d3aff73e7
commit
38ad79b1d7
@ -80,6 +80,8 @@ public class SysUserDetails implements UserDetails, CredentialsContainer {
|
||||
Long userId,
|
||||
String username,
|
||||
String password,
|
||||
Integer dataScope,
|
||||
Long deptId,
|
||||
boolean enabled,
|
||||
boolean accountNonExpired,
|
||||
boolean credentialsNonExpired,
|
||||
@ -91,6 +93,8 @@ public class SysUserDetails implements UserDetails, CredentialsContainer {
|
||||
this.userId = userId;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.dataScope = dataScope;
|
||||
this.deptId = deptId;
|
||||
this.enabled = enabled;
|
||||
this.accountNonExpired = accountNonExpired;
|
||||
this.credentialsNonExpired = credentialsNonExpired;
|
||||
|
@ -49,11 +49,13 @@ class SysUserDeserializer extends JsonDeserializer<SysUserDetails> {
|
||||
Long userId = readJsonNode(jsonNode, "userId").asLong();
|
||||
String username = readJsonNode(jsonNode, "username").asText();
|
||||
String password = passwordNode.asText("");
|
||||
Integer dataScope = readJsonNode(jsonNode, "dataScope").asInt();
|
||||
Long deptId = readJsonNode(jsonNode, "deptId").asLong();
|
||||
boolean enabled = readJsonNode(jsonNode, "enabled").asBoolean();
|
||||
boolean accountNonExpired = readJsonNode(jsonNode, "accountNonExpired").asBoolean();
|
||||
boolean credentialsNonExpired = readJsonNode(jsonNode, "credentialsNonExpired").asBoolean();
|
||||
boolean accountNonLocked = readJsonNode(jsonNode, "accountNonLocked").asBoolean();
|
||||
SysUserDetails result = new SysUserDetails(userId, username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked,
|
||||
SysUserDetails result = new SysUserDetails(userId, username, password, dataScope, deptId, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked,
|
||||
authorities);
|
||||
if (passwordNode.asText(null) == null) {
|
||||
result.eraseCredentials();
|
||||
|
Loading…
Reference in New Issue
Block a user