soc-gateway-dev.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. spring:
  2. cloud:
  3. gateway:
  4. globalcors:
  5. corsConfigurations:
  6. '[/**]':
  7. allowedOriginPatterns: "*"
  8. allowed-methods: "*"
  9. allowed-headers: "*"
  10. allow-credentials: true
  11. exposedHeaders: "Content-Disposition,Content-Type,Cache-Control"
  12. discovery:
  13. locator:
  14. lowerCaseServiceId: true
  15. enabled: true
  16. routes:
  17. # 认证中心
  18. - id: soc-auth
  19. uri: lb://soc-auth
  20. predicates:
  21. - Path=/auth/**
  22. filters:
  23. # 验证码处理
  24. - CacheRequestFilter
  25. - ValidateCodeFilter
  26. - StripPrefix=1
  27. # 代码生成
  28. - id: soc-gen
  29. uri: lb://soc-gen
  30. predicates:
  31. - Path=/code/*/*
  32. filters:
  33. - StripPrefix=1
  34. # 定时任务
  35. - id: soc-job
  36. uri: lb://soc-job
  37. predicates:
  38. - Path=/schedule/**
  39. filters:
  40. - StripPrefix=1
  41. # 系统模块
  42. - id: soc-system
  43. uri: lb://soc-system
  44. predicates:
  45. - Path=/system/**
  46. filters:
  47. - StripPrefix=1
  48. # 文件服务
  49. - id: soc-file
  50. uri: lb://soc-file
  51. predicates:
  52. - Path=/file/**
  53. filters:
  54. - StripPrefix=1
  55. # 核心服务
  56. - id: soc-core
  57. uri: lb://soc-core
  58. predicates:
  59. - Path=/core/**
  60. filters:
  61. - StripPrefix=1
  62. # 同步服务
  63. - id: soc-sync
  64. uri: lb://soc-sync
  65. predicates:
  66. - Path=/sync/**
  67. filters:
  68. - StripPrefix=1
  69. # 北向服务
  70. - id: soc-mediator
  71. uri: lb://soc-mediator
  72. predicates:
  73. - Path=/mediator/**
  74. filters:
  75. - StripPrefix=1
  76. - id: soc-iot
  77. uri: lb://soc-iot
  78. predicates:
  79. - Path=/iot/**
  80. filters:
  81. - StripPrefix=1
  82. # 短信服务
  83. - id: soc-sms
  84. uri: lb://soc-sms
  85. predicates:
  86. - Path=/sms/**
  87. filters:
  88. - StripPrefix=1
  89. # 部署中心服务
  90. - id: soc-deploy
  91. uri: lb://soc-deploy
  92. predicates:
  93. - Path=/api/deploy/**
  94. filters:
  95. - StripPrefix=2
  96. # websocket模块
  97. - id: soc-websocket
  98. uri: lb:ws://soc-system
  99. predicates:
  100. - Path=/websocket/**
  101. - id: soc-websocket
  102. uri: lb:ws://soc-mediator
  103. predicates:
  104. - Path=/ws/**
  105. - id: soc-websocket
  106. uri: lb:ws://soc-mediator
  107. predicates:
  108. - Path=/ws1/**
  109. - id: soc-host
  110. uri: lb:ws://soc-host
  111. predicates:
  112. - Path=/host/**
  113. - id: soc-host
  114. uri: lb:ws://soc-host
  115. predicates:
  116. - Path=/host1/**
  117. # 安全配置
  118. security:
  119. # 验证码
  120. captcha:
  121. enabled: false
  122. type: math
  123. # 防止XSS攻击
  124. xss:
  125. enabled: true
  126. excludeUrls:
  127. - /system/notice
  128. - /system/config
  129. # 不校验白名单
  130. ignore:
  131. whites:
  132. - /auth/logout
  133. - /auth/logoutApp
  134. - /auth/tokenlogin
  135. - /auth/login
  136. - /auth/loginApp
  137. - /auth/register
  138. - /*/v2/api-docs
  139. - /csrf
  140. - /mediator/**
  141. - /system/version/checkUpdate
  142. - /system/version/download/*
  143. - /file/file/getFile/*
  144. - /api/deploy/register
  145. - /api/deploy/accesstoken
  146. - /api/deploy/package/download/**
  147. - /api/deploy/agent/download/**
  148. - /api/deploy/frontend/synchronDate
  149. - /api/deploy/heartbeat
  150. - /api/deploy/list
  151. - /api/deploy/report
  152. - /api/deploy/task
  153. - /api/deploy/taskReport
  154. - /ws/**
  155. - /ws1/**
  156. - /host/**
  157. - /host1/**