1、报错截图

springboot引入security,测试接口报Unauthorized-LMLPHP

2、当前项目pom文件引入security

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-security</artifactId>
    <version>2.2.2.RELEASE</version>
</dependency>

3、解决办法

@SpringBootApplication(exclude = {SecurityAutoConfiguration.class,
        ManagementWebSecurityAutoConfiguration.class})
05-14 23:15