ruoyi-gateway.yml 2.5 KB

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