单点登录添加用户姓名信息
This commit is contained in:
parent
5954efd25e
commit
66f896bc04
@ -57,6 +57,7 @@ public class UserAuthConverter implements UserAuthenticationConverter {
|
||||
UserInfoBO userInfoBO = new UserInfoBO();
|
||||
userInfoBO.setUserId(userBO.getUserId());
|
||||
userInfoBO.setUserUsername(userBO.getUsername());
|
||||
userInfoBO.setUserName(userBO.getUserName());
|
||||
principal = userInfoBO;
|
||||
} else {
|
||||
// 包含用户信息,则直接抽取其中的用户信息
|
||||
@ -65,6 +66,7 @@ public class UserAuthConverter implements UserAuthenticationConverter {
|
||||
UserInfoBO userInfoBO = new UserInfoBO();
|
||||
userInfoBO.setUserId(userInfo.get("userId").toString());
|
||||
userInfoBO.setUserUsername(userInfo.get("username").toString());
|
||||
userInfoBO.setUserName(userInfo.get("userName").toString());
|
||||
principal = userInfoBO;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
||||
public class UserBO extends User {
|
||||
|
||||
private String userId;
|
||||
private String userName;
|
||||
private List<RoleBO> roles;
|
||||
private List<GroupBO> groups;
|
||||
private List<DepartmentBO> departments;
|
||||
@ -40,6 +41,14 @@ public class UserBO extends User {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName == null ? "" : userName.trim();
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public List<RoleBO> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
@ -69,6 +78,8 @@ public class UserBO extends User {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"userId\":")
|
||||
.append("\"").append(userId).append("\"");
|
||||
sb.append(",\"userName\":")
|
||||
.append("\"").append(userName).append("\"");
|
||||
sb.append(",\"roles\":")
|
||||
.append(roles);
|
||||
sb.append(",\"groups\":")
|
||||
|
Loading…
Reference in New Issue
Block a user