application-routes.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # 默认路由规则
  2. ---
  3. spring:
  4. profiles: routes
  5. cloud:
  6. gateway:
  7. default-filters:
  8. #- PrefixPath=/httpbin
  9. #- JwtParser=.*/login
  10. - AddResponseHeader=Cache-Control, no-cache
  11. - AddResponseHeader=Pragma, no-cache
  12. - AddResponseHeader=Expires, -1
  13. # - RewritePath=/api/gaf/(?<segment>.*), /gaf/$\{segment}
  14. routes:
  15. # 验证码接口
  16. - id: gaf_verify
  17. uri: ${uri.gaf}
  18. predicates:
  19. - Path=/api/gaf/verify/**
  20. filters:
  21. - RewritePath=/api/gaf/(?<segment>.*), /gaf/$\{segment}
  22. - Forward
  23. # == 默认处理 ==
  24. - id: index
  25. uri: forward:///index # default for unauthorized
  26. predicates:
  27. - Path=/
  28. filters:
  29. - RedirectTo=302, /admin/index.html
  30. - id: api_default
  31. uri: forward:///401 # default for unauthorized
  32. order: 1000
  33. predicates:
  34. - Path=/api/**
  35. #- Method=POST
  36. filters:
  37. - SetStatus=401