ruoyi-gateway.yml 2.1 KB

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