非法令牌、如果没有登录、没有访问权限、访问就出现
检查是否登录
检查路由的顺序
精确路由高优先级 放在前、
模糊路由低优先级 放在后
spring:
cloud:
gateway:
routes:
- id : product_route
uri: lb://gulimall-fast
predicates:
- Path=/api/product/**
filters:
- RewritePath=/api/(?<segment>.*),/$\{segment}
## https://localhost:88/api/product/list/tree ---> https://localhost:10000//product/list/tree 找到gulimall-fast服务换端口10000,正则去掉api
- id : admin_route
uri: lb://renren-fast
predicates:
- Path=/api/**
filters :
- RewritePath=/api/(?<segment>.*),/renren-fast/$\{segment}
## https://localhost:88/api/a.jpg ---> https://localhost:8080/renren-fast/a.jpg 找renren-fast服务换端口8080、正则 把api换成renren-fast
模糊断言要写在精确断言后