String username=SecurityContextHolder.getContext().getAuthentication().getName();
AuthUser user=userRepository.findFirstByUserName(username);
SecurityContextHolder ==>从ThreadLocal中获取用户
ThreadLocal==>用于保存某个线程共享变量
String username=SecurityContextHolder.getContext().getAuthentication().getName();
AuthUser user=userRepository.findFirstByUserName(username);
SecurityContextHolder ==>从ThreadLocal中获取用户
ThreadLocal==>用于保存某个线程共享变量