application-routes.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 默认路由规则
  2. ---
  3. spring:
  4. profiles: routes
  5. cloud:
  6. gateway:
  7. default-filters:
  8. - AddResponseHeader=Cache-Control, no-cache
  9. - AddResponseHeader=Pragma, no-cache
  10. - AddResponseHeader=Expires, -1
  11. - PeekRequestBody
  12. routes:
  13. # 验证码接口
  14. - id: gaf_verify
  15. uri: ${uri.gaf}
  16. predicates:
  17. - Path=/api/gaf/verify/**
  18. filters:
  19. - RewritePath=/api/gaf/(?<segment>.*), /gaf/$\{segment}
  20. - Forward
  21. # 登录接口验证
  22. - id: login_verify
  23. uri: ${uri.xms}
  24. predicates:
  25. - Path=/api/gaf/verify/**
  26. filters:
  27. - VerifyCode
  28. - RewritePath=/api/gaf/(?<segment>.*), /gaf/$\{segment}
  29. # API接口
  30. - id: xms_api
  31. uri: ${uri.xms}
  32. predicates:
  33. - Path=/api/xms/**
  34. - Jwt=issuer, gaf
  35. filters:
  36. - RewritePath=/api/(?<segment>.*), /$\{segment}
  37. # == 默认处理 ==
  38. - id: api_default
  39. uri: forward:///401 # default for unauthorized
  40. order: 1000
  41. predicates:
  42. - Path=/api/**
  43. filters:
  44. - SetStatus=401