解决在工具类中使用@Autowired为null的问题 正确的使用方法如下所示 正确的使用方法如下所示 @Component public class TreeUtil { @Autowired UserMapper userMapper; public static TreeUtil treeUtil; @PostConstruct public void init() { treeUtil