ruoyi-gateway-dev.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # 将此内容填入nacos对应的配置内容中
  2. spring:
  3. cloud:
  4. gateway:
  5. discovery:
  6. locator:
  7. lowerCaseServiceId: true
  8. enabled: true
  9. routes:
  10. # 认证中心
  11. - id: ruoyi-auth
  12. uri: lb://ruoyi-auth
  13. predicates:
  14. - Path=/auth/**
  15. filters:
  16. # 验证码处理
  17. - CacheRequestFilter
  18. - ValidateCodeFilter
  19. - StripPrefix=1
  20. # 代码生成
  21. - id: ruoyi-gen
  22. uri: lb://ruoyi-gen
  23. predicates:
  24. - Path=/code/**
  25. filters:
  26. - StripPrefix=1
  27. # 定时任务
  28. - id: ruoyi-job
  29. uri: lb://ruoyi-job
  30. predicates:
  31. - Path=/schedule/**
  32. filters:
  33. - StripPrefix=1
  34. # 系统模块
  35. - id: ruoyi-system
  36. uri: lb://ruoyi-system
  37. predicates:
  38. - Path=/system/**
  39. filters:
  40. - StripPrefix=1
  41. # 文件服务
  42. - id: ruoyi-file
  43. uri: lb://ruoyi-file
  44. predicates:
  45. - Path=/file/**
  46. filters:
  47. - StripPrefix=1
  48. # 安全配置
  49. security:
  50. # 验证码
  51. captcha:
  52. enabled: true
  53. type: math
  54. # 防止XSS攻击
  55. xss:
  56. enabled: true
  57. excludeUrls:
  58. - /system/notice
  59. # 不校验白名单
  60. ignore:
  61. whites:
  62. - /auth/logout
  63. - /auth/login
  64. - /auth/register
  65. - /*/v2/api-docs
  66. - /csrf