baseUserService 服务增加异常捕获

This commit is contained in:
ajaxfan
2021-05-11 14:43:31 +08:00
parent d11cfe51fc
commit 8c83be901d

View File

@ -31,13 +31,11 @@ public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
@Override
public BaseCacheUser getCacheUser() {
BaseCacheUser buser = new BaseCacheUser();
System.out.println(SecurityContextHolder.getContext());
System.out.println(SecurityContextHolder.getContext().getAuthentication());
System.out.println(SecurityContextHolder.getContext().getAuthentication().getPrincipal());
BeanUtils.copyProperties(SecurityContextHolder.getContext().getAuthentication().getPrincipal(), buser);
try {
BeanUtils.copyProperties(SecurityContextHolder.getContext().getAuthentication().getPrincipal(), buser);
} catch (Exception e) {
log.error(e.getMessage());
}
log.debug("Current user principal: " + buser);
return buser;