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