ruoyi-gateway.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. - /code
  24. - /auth/logout
  25. - /auth/login
  26. - /auth/smsLogin
  27. - /auth/xcxLogin
  28. - /auth/register
  29. - /auth/tenant/list
  30. - /resource/sms/code
  31. - /*/v3/api-docs
  32. - /csrf
  33. spring:
  34. cloud:
  35. # 网关配置
  36. gateway:
  37. # 打印请求日志(自定义)
  38. requestLog: true
  39. discovery:
  40. locator:
  41. lowerCaseServiceId: true
  42. enabled: true
  43. routes:
  44. # 认证中心
  45. - id: ruoyi-auth
  46. uri: lb://ruoyi-auth
  47. predicates:
  48. - Path=/auth/**
  49. filters:
  50. # 验证码处理
  51. - ValidateCodeFilter
  52. - StripPrefix=1
  53. # 代码生成
  54. - id: ruoyi-gen
  55. uri: lb://ruoyi-gen
  56. predicates:
  57. - Path=/tool/**
  58. filters:
  59. - StripPrefix=1
  60. # 系统模块
  61. - id: ruoyi-system
  62. uri: lb://ruoyi-system
  63. predicates:
  64. - Path=/system/**
  65. filters:
  66. - StripPrefix=1
  67. # 监控模块
  68. - id: ruoyi-monitor
  69. uri: lb://ruoyi-system
  70. predicates:
  71. - Path=/monitor/**
  72. filters:
  73. - StripPrefix=1
  74. # 资源服务
  75. - id: ruoyi-resource
  76. uri: lb://ruoyi-resource
  77. predicates:
  78. - Path=/resource/**
  79. filters:
  80. - StripPrefix=1
  81. # 演示服务
  82. - id: ruoyi-demo
  83. uri: lb://ruoyi-demo
  84. predicates:
  85. - Path=/demo/**
  86. filters:
  87. - StripPrefix=1
  88. # MQ演示服务
  89. - id: ruoyi-stream-mq
  90. uri: lb://ruoyi-stream-mq
  91. predicates:
  92. - Path=/stream-mq/**
  93. filters:
  94. - StripPrefix=1
  95. # sentinel 配置
  96. sentinel:
  97. filter:
  98. enabled: false
  99. # nacos配置持久化
  100. datasource:
  101. ds1:
  102. nacos:
  103. server-addr: ${spring.cloud.nacos.server-addr}
  104. dataId: sentinel-${spring.application.name}.json
  105. groupId: ${spring.cloud.nacos.config.group}
  106. namespace: ${spring.profiles.active}
  107. data-type: json
  108. rule-type: gw-flow