ruoyi-gateway.yml 2.0 KB

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