ruoyi-gateway.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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/**,/monitor/**
  65. filters:
  66. - StripPrefix=1
  67. # 资源服务
  68. - id: ruoyi-resource
  69. uri: lb://ruoyi-resource
  70. predicates:
  71. - Path=/resource/**
  72. filters:
  73. - StripPrefix=1
  74. # 演示服务
  75. - id: ruoyi-demo
  76. uri: lb://ruoyi-demo
  77. predicates:
  78. - Path=/demo/**
  79. filters:
  80. - StripPrefix=1
  81. # MQ演示服务
  82. - id: ruoyi-stream-mq
  83. uri: lb://ruoyi-stream-mq
  84. predicates:
  85. - Path=/stream-mq/**
  86. filters:
  87. - StripPrefix=1
  88. # sentinel 配置
  89. sentinel:
  90. filter:
  91. enabled: false
  92. # nacos配置持久化
  93. datasource:
  94. ds1:
  95. nacos:
  96. server-addr: ${spring.cloud.nacos.server-addr}
  97. dataId: sentinel-${spring.application.name}.json
  98. groupId: ${spring.cloud.nacos.config.group}
  99. namespace: ${spring.profiles.active}
  100. data-type: json
  101. rule-type: gw-flow