diff --git a/youlai-auth/src/main/java/com/youlai/auth/model/SysUserDetails.java b/youlai-auth/src/main/java/com/youlai/auth/model/SysUserDetails.java index 13cac7bb8..c08e8f228 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/model/SysUserDetails.java +++ b/youlai-auth/src/main/java/com/youlai/auth/model/SysUserDetails.java @@ -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; diff --git a/youlai-auth/src/main/java/com/youlai/auth/oauth2/jackson/SysUserDeserializer.java b/youlai-auth/src/main/java/com/youlai/auth/oauth2/jackson/SysUserDeserializer.java index 0f7f3a4de..2461b79e7 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/oauth2/jackson/SysUserDeserializer.java +++ b/youlai-auth/src/main/java/com/youlai/auth/oauth2/jackson/SysUserDeserializer.java @@ -49,11 +49,13 @@ class SysUserDeserializer extends JsonDeserializer { 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(); diff --git a/youlai-system/system-boot/src/main/resources/mapper/SysDeptMapper.xml b/youlai-system/system-boot/src/main/resources/mapper/SysDeptMapper.xml index ecf26412b..17da0ce32 100644 --- a/youlai-system/system-boot/src/main/resources/mapper/SysDeptMapper.xml +++ b/youlai-system/system-boot/src/main/resources/mapper/SysDeptMapper.xml @@ -4,21 +4,4 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - id,name,parent_id, - tree_path,sort,status, - deleted,create_time,update_time -