受到启发 找到我的报错原因:使用了 @Autowired 注解 或者给类加注解 @Component 参考文章:https://blog.csdn.net/wh456413/article/details/106687705