springboot security 获取当前登录用户名

System.out.println(((User)SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getName());

${session.SPRING_SECURITY_CONTEXT.authentication.principal.name}

猜你喜欢

转载自www.cnblogs.com/white-knight/p/8979792.html