ruoyi-gateway.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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/register
  27. - /*/v2/api-docs
  28. - /csrf
  29. spring:
  30. cloud:
  31. # 网关配置
  32. gateway:
  33. discovery:
  34. locator:
  35. lowerCaseServiceId: true
  36. enabled: true
  37. routes:
  38. # 认证中心
  39. - id: ruoyi-auth
  40. uri: lb://ruoyi-auth
  41. predicates:
  42. - Path=/auth/**
  43. filters:
  44. # 验证码处理
  45. - CacheRequestFilter
  46. - ValidateCodeFilter
  47. - StripPrefix=1
  48. # 代码生成
  49. - id: ruoyi-gen
  50. uri: lb://ruoyi-gen
  51. predicates:
  52. - Path=/code/**
  53. filters:
  54. - StripPrefix=1
  55. # 系统模块
  56. - id: ruoyi-system
  57. uri: lb://ruoyi-system
  58. predicates:
  59. - Path=/system/**
  60. filters:
  61. - StripPrefix=1
  62. # 资源服务
  63. - id: ruoyi-resource
  64. uri: lb://ruoyi-resource
  65. predicates:
  66. - Path=/resource/**
  67. filters:
  68. - StripPrefix=1
  69. # sentinel 配置
  70. sentinel:
  71. # nacos配置持久化
  72. datasource:
  73. ds1:
  74. nacos:
  75. server-addr: ${spring.cloud.nacos.server-addr}
  76. dataId: sentinel-${spring.application.name}.json
  77. groupId: ${spring.cloud.nacos.config.group}
  78. namespace: ${spring.profiles.active}
  79. data-type: json
  80. rule-type: flow