ruoyi-gateway.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # 安全配置
  2. security:
  3. # 验证码
  4. captcha:
  5. # 是否开启验证码
  6. enabled: true
  7. # 验证码类型 math 数组计算 char 字符验证
  8. type: MATH
  9. # line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
  10. category: CIRCLE
  11. # 数字验证码位数
  12. numberLength: 1
  13. # 字符验证码长度
  14. charLength: 4
  15. # 防止XSS攻击
  16. xss:
  17. enabled: true
  18. excludeUrls:
  19. - /system/notice
  20. # 不校验白名单
  21. ignore:
  22. whites:
  23. - /auth/logout
  24. - /auth/login
  25. - /auth/register
  26. - /*/v2/api-docs
  27. - /csrf
  28. spring:
  29. cloud:
  30. # 网关配置
  31. gateway:
  32. discovery:
  33. locator:
  34. lowerCaseServiceId: true
  35. enabled: true
  36. routes:
  37. # 认证中心
  38. - id: ruoyi-auth
  39. uri: lb://ruoyi-auth
  40. predicates:
  41. - Path=/auth/**
  42. filters:
  43. # 验证码处理
  44. - CacheRequestFilter
  45. - ValidateCodeFilter
  46. - StripPrefix=1
  47. # 代码生成
  48. - id: ruoyi-gen
  49. uri: lb://ruoyi-gen
  50. predicates:
  51. - Path=/code/**
  52. filters:
  53. - StripPrefix=1
  54. # 定时任务
  55. - id: ruoyi-job
  56. uri: lb://ruoyi-job
  57. predicates:
  58. - Path=/schedule/**
  59. filters:
  60. - StripPrefix=1
  61. # 系统模块
  62. - id: ruoyi-system
  63. uri: lb://ruoyi-system
  64. predicates:
  65. - Path=/system/**
  66. filters:
  67. - StripPrefix=1
  68. # 文件服务
  69. - id: ruoyi-file
  70. uri: lb://ruoyi-file
  71. predicates:
  72. - Path=/file/**
  73. filters:
  74. - StripPrefix=1
  75. # sentinel 配置
  76. sentinel:
  77. # nacos配置持久化
  78. datasource:
  79. ds1:
  80. nacos:
  81. server-addr: ${spring.cloud.nacos.server-addr}
  82. dataId: sentinel-${spring.application.name}
  83. groupId: ${spring.cloud.nacos.config.group}
  84. namespace: ${spring.profiles.active}
  85. data-type: json
  86. rule-type: flow