baseUserService 服务增加异常捕获
This commit is contained in:
@ -31,13 +31,11 @@ public class BaseCacheUserServiceImpl implements IBaseCacheUserService {
|
|||||||
@Override
|
@Override
|
||||||
public BaseCacheUser getCacheUser() {
|
public BaseCacheUser getCacheUser() {
|
||||||
BaseCacheUser buser = new BaseCacheUser();
|
BaseCacheUser buser = new BaseCacheUser();
|
||||||
|
try {
|
||||||
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);
|
BeanUtils.copyProperties(SecurityContextHolder.getContext().getAuthentication().getPrincipal(), buser);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
log.debug("Current user principal: " + buser);
|
log.debug("Current user principal: " + buser);
|
||||||
|
|
||||||
return buser;
|
return buser;
|
||||||
|
Reference in New Issue
Block a user