💄 Updating the UI and style files. #1054 【重构】 登录流程简化,减少DB 访问

💄 Updating the UI and style files. #1054 【重构】 登录流程简化,减少DB 访问
This commit is contained in:
冷冷 committed 2020-04-20 10:01:48 +08:00
1 parent 357e2d8ab2
commit e470d9f6ed
2 files changed
+4 -2

No files matched your search

@@ -52,6 +52,8 @@ public class PigxTokenEnhancer implements TokenEnhancer {
final Map<String, Object> additionalInfo = new HashMap<>(8);
PigxUser pigxUser = (PigxUser) authentication.getUserAuthentication().getPrincipal();
additionalInfo.put(SecurityConstants.DETAILS_USER, pigxUser);
additionalInfo.put(SecurityConstants.DETAILS_USER_ID, pigxUser.getId());
additionalInfo.put(SecurityConstants.DETAILS_USERNAME, pigxUser.getUsername());
additionalInfo.put(SecurityConstants.DETAILS_LICENSE, SecurityConstants.PIGX_LICENSE);
additionalInfo.put(SecurityConstants.ACTIVE, Boolean.TRUE);
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);
@@ -170,8 +170,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
if (ENCODER.matches(userDto.getPassword(), userVO.getPassword())) {
sysUser.setPassword(ENCODER.encode(userDto.getNewpassword1()));
} else {
log.warn("原密码错误,修改密码失败:{}", userDto.getUsername());
return R.ok(Boolean.FALSE, "原密码错误,修改失败");
log.info("原密码错误,修改密码失败:{}", userDto.getUsername());
return R.failed("原密码错误,修改失败");
}
}
sysUser.setPhone(userDto.getPhone());