pig4cloud 对 Spring Security OAtuh2 的资源服务器配置进行了封装,只需要一个注解即可完成相关的操作

引入 pom

  1. <!--安全模块-->
  2. <dependency>
  3. <groupId>com.pig4cloud</groupId>
  4. <artifactId>pig-common-security</artifactId>
  5. <version>laster.version</version>
  6. </dependency>

main 方法开启 @EnablePigResourceServer

  1. @EnablePigResourceServer
  2. @EnablePigFeignClients
  3. @SpringCloudApplication
  4. public class PigAdminApplication {
  5. public static void main(String[] args) {
  6. SpringApplication.run(PigAdminApplication.class, args);
  7. }
  8. }