http://localhost:8088/setSession
引入 Spring Session 依赖
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
配置存储类型
spring:
session:
store-type: redis
开启redis作为spring session
@EnableRedisHttpSession // 开启使用redis作为spring session
去除安全自动装配
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})