ruoyi-gateway.yml 2.0 KB

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