用AOP切面使用中出现了个问题

img

如图
这里配置的切面表达式 user 初在idea中显示红色,快捷提示找不到我要切如的方法
实际运行中却能切如,目标方法,能有老哥说明一下吗。

再是
启动类中,我注释掉了 @EnableAspectJAutoProxy 为啥切面还能有效

@SpringBootApplication
@MapperScan(basePackages = "com.imooc.user.mapper")
@ComponentScan(basePackages = {"com.imooc","org.n3r.idworker"})//org/n3r/idworker
//@EnableAspectJAutoProxy
//@EnableTransactionManagement
public class Application {

  1. 红色:可能为 idea 缓存问题,可尝试关闭 idea 删除项目下 .idea 目录再重启 idea。
  2. 取消注释仍生效,Spring Boot 项目中引入 spring-boot-starter-aop 依赖后会自动添加 @EnableAspectJAutoProxy 注解,这个注解只有在 Spring Framework 环境下才需要手动添加。

如有帮助,请采纳。