ruoyi-gateway.yml 2.0 KB

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