在你的SpringBoot启动类 中SpringApplication.run(XXX.class,args);后面添加一句代码:
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
所需依赖:
import org.springframework.security.core.context.SecurityContextHolder;
如图所示:
在你的SpringBoot启动类 中SpringApplication.run(XXX.class,args);后面添加一句代码:
SecurityContextHolder.setStrategyName(SecurityContextHolder.MODE_GLOBAL);
所需依赖:
import org.springframework.security.core.context.SecurityContextHolder;
如图所示: