ruoyi-gateway.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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-job
  57. uri: lb://ruoyi-job
  58. predicates:
  59. - Path=/schedule/**
  60. filters:
  61. - StripPrefix=1
  62. # 系统模块
  63. - id: ruoyi-system
  64. uri: lb://ruoyi-system
  65. predicates:
  66. - Path=/system/**
  67. filters:
  68. - StripPrefix=1
  69. # 文件服务
  70. - id: ruoyi-file
  71. uri: lb://ruoyi-file
  72. predicates:
  73. - Path=/file/**
  74. filters:
  75. - StripPrefix=1
  76. # sentinel 配置
  77. sentinel:
  78. # nacos配置持久化
  79. datasource:
  80. ds1:
  81. nacos:
  82. server-addr: ${spring.cloud.nacos.server-addr}
  83. dataId: sentinel-${spring.application.name}
  84. groupId: ${spring.cloud.nacos.config.group}
  85. namespace: ${spring.profiles.active}
  86. data-type: json
  87. rule-type: flow