This commit is contained in:
hxr 2024-03-07 00:13:13 +08:00
commit 96e39c445a
3 changed files with 7 additions and 18 deletions

View File

@ -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;

View File

@ -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();

View File

@ -4,21 +4,4 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.youlai.system.mapper.SysDeptMapper">
<resultMap id="BaseResultMap" type="com.youlai.system.model.entity.SysDept">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="parentId" column="parent_id" jdbcType="BIGINT"/>
<result property="treePath" column="tree_path" jdbcType="VARCHAR"/>
<result property="sort" column="sort" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="TINYINT"/>
<result property="deleted" column="deleted" jdbcType="TINYINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id,name,parent_id,
tree_path,sort,status,
deleted,create_time,update_time
</sql>
</mapper>