📅  最后修改于: 2022-03-11 14:52:38.005000             🧑  作者: Mango
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication()
.getPrincipal();
String username = userDetails.getUsername();