|
|
@ -121,21 +121,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us |
|
|
|
OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) currentAuthentication; |
|
|
|
OAuth2Authentication oAuth2Authentication = (OAuth2Authentication) currentAuthentication; |
|
|
|
OAuth2AccessToken accessToken = tokenStore.getAccessToken(oAuth2Authentication); |
|
|
|
OAuth2AccessToken accessToken = tokenStore.getAccessToken(oAuth2Authentication); |
|
|
|
OAuth2Request oAuth2Request = oAuth2Authentication.getOAuth2Request(); |
|
|
|
OAuth2Request oAuth2Request = oAuth2Authentication.getOAuth2Request(); |
|
|
|
KiccUser currentKiccUser = SecurityUtils.getUser(); |
|
|
|
|
|
|
|
// 更新当前授权成功用户的信息
|
|
|
|
// 更新当前授权成功用户的信息
|
|
|
|
KiccUser kiccUser = new KiccUser( |
|
|
|
KiccUser kiccUser = SecurityUtils.getUser().setTenantId(StrUtil.join(",", tenantIds)); |
|
|
|
currentKiccUser.getId(), |
|
|
|
|
|
|
|
currentKiccUser.getDeptId(), |
|
|
|
|
|
|
|
currentKiccUser.getUsername(), |
|
|
|
|
|
|
|
currentKiccUser.getPassword(), |
|
|
|
|
|
|
|
currentKiccUser.getPhone(), |
|
|
|
|
|
|
|
StrUtil.join(",", tenantIds), |
|
|
|
|
|
|
|
currentKiccUser.isEnabled(), |
|
|
|
|
|
|
|
currentKiccUser.isAccountNonExpired(), |
|
|
|
|
|
|
|
currentKiccUser.isCredentialsNonExpired(), |
|
|
|
|
|
|
|
currentKiccUser.isAccountNonLocked(), |
|
|
|
|
|
|
|
currentKiccUser.getAuthorities() |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
// 加载用户名密码身份验证令牌
|
|
|
|
// 加载用户名密码身份验证令牌
|
|
|
|
Authentication userAuthentication = new UsernamePasswordAuthenticationToken(kiccUser, "N/A", kiccUser.getAuthorities()); |
|
|
|
Authentication userAuthentication = new UsernamePasswordAuthenticationToken(kiccUser, "N/A", kiccUser.getAuthorities()); |
|
|
|
OAuth2Authentication authentication = new OAuth2Authentication(oAuth2Request, userAuthentication); |
|
|
|
OAuth2Authentication authentication = new OAuth2Authentication(oAuth2Request, userAuthentication); |
|
|
@ -143,6 +130,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us |
|
|
|
tokenStore.storeAccessToken(accessToken, authentication); |
|
|
|
tokenStore.storeAccessToken(accessToken, authentication); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 新增用户角色信息 |
|
|
|
* 新增用户角色信息 |
|
|
|
* @param user 用户对象 |
|
|
|
* @param user 用户对象 |
|
|
|