1、登录校验
登录校验两个步骤:
前端请求带上token,放在header里。
后端校验token有效性,在gateway里统一校验。
gateway有多个拦截器时,使用order来确定拦截器的顺序。
1.1、gateway模块导入依赖
在gateway/pom.xml中:
<!-- hutool-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<!-- 热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</opt