解决SpringBoot拦截器中无法依赖注入bean

SpringBoot的拦截器是在Bean实例化之前就执行了,

只需要在拦截器配置类里面将需要依赖注入的拦截器实例化就行了:

image-20211010201817375

在HasAuth中:RedisTemplate就能注入进来了

image-20211010201917984

Guess you like

Origin blog.csdn.net/qq_42682745/article/details/120691641