瀏覽代碼

consul替换nacos

pull/30/head
wubin 2 年之前
父節點
當前提交
8cf2331844
共有 8 個文件被更改,包括 574 次插入501 次删除
  1. +42
    -5
      pom.xml
  2. +0
    -168
      src/main/resources/application-dev.yml
  3. +0
    -167
      src/main/resources/application-local.yml
  4. +0
    -161
      src/main/resources/application-test.yml
  5. +180
    -0
      src/main/resources/bootstrap-dev.yml
  6. +179
    -0
      src/main/resources/bootstrap-local.yml
  7. +173
    -0
      src/main/resources/bootstrap-test.yml
  8. +0
    -0
      src/main/resources/bootstrap.yml

+ 42
- 5
pom.xml 查看文件

@@ -15,6 +15,7 @@
<description>tuoheng_gateway</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud-alibaba.version>2021.0.1.0</spring-cloud-alibaba.version>
</properties>
<dependencies>
<dependency>
@@ -22,11 +23,11 @@
<artifactId>spring-cloud-starter-gateway</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
<version>3.1.1</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-discovery</artifactId>-->
<!-- <version>3.1.1</version>-->
<!-- </dependency>-->

<dependency>
<groupId>com.auth0</groupId>
@@ -87,6 +88,42 @@
<version>1.18.22</version>
</dependency>

<!-- SpringCloud Alibaba Nacos -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
<version>${spring-cloud-alibaba.version}</version>
<exclusions>
<!-- 将ribbon排除 -->
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--添加loadbalancer依赖
由于 Netflix Ribbon 进入停更维护阶段,因此 SpringCloud 2020.0.1 版本之后 删除了eureka中的ribbon,
替代ribbon的是spring cloud自带的LoadBalancer,默认使用的是轮询的方式
新版本的 Nacos discovery 都已经移除了 Ribbon ,此时我们需要引入 loadbalancer 代替,才能调用服务提供者提供的服务
-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
<version>3.1.3</version>
</dependency>

<!-- SpringCloud Alibaba Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
<version>${spring-cloud-alibaba.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
<version>3.0.3</version>
</dependency>

</dependencies>

<!-- 构建环境变量 -->

+ 0
- 168
src/main/resources/application-dev.yml 查看文件

@@ -1,168 +0,0 @@
spring:
security:
oauth2:
resource-server:
jwt:
issuer-uri: http://192.168.11.11:8090
#issuer-uri: http://oidc.dev.t-aaron.com
cloud:
consul:
host: 192.168.11.13 # consul 所在服务地址
port: 8500 # consul 服务端口
discovery:
enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
## consul ip地址
hostname: 192.168.11.13
# 注册到consul的服务名称
service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
heartbeat:
enabled: true
prefer-ip-address: true #表示注册时使用IP而不是hostname
health-check-path: /actuator/health #健康检查
health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
health-check-timeout: 10s #健康检查超时
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
# 跨域设置
globalcors:
add-to-simple-url-handler-mapping: true
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:8001"
allowedMethods:
- "GET"
- "POST"
- "DELETE"
- "PUT"
- "OPTIONS"
allowedHeaders: "*"
allowCredentials: true
maxAge: 360000
routes:
# 认证中心
- id: tuoheng-auth
uri: lb://tuoheng-auth
predicates:
- Path=/api/auth/**
filters:
- StripPrefix=2
# 系统模块
- id: tuoheng-dsp-system
uri: lb://tuoheng-dsp-system
predicates:
- Path=/api/system/**
filters:
- StripPrefix=2
# 代码生成器
- id: tuoheng-generator
uri: lb://tuoheng-generator
predicates:
- Path=/api/generator/**
filters:
- StripPrefix=2
# 后台管理
- id: tuoheng-dsp-admin
uri: lb://tuoheng-dsp-admin
predicates:
- Path=/api/admin/**
filters:
- StripPrefix=2
# 网站服务
- id: tuoheng-dsp-portal
uri: lb://tuoheng-dsp-portal
predicates:
- Path=/api/portal/**
filters:
- StripPrefix=2
# 网站服务
- id: tuoheng-manage
uri: lb://tuoheng-manage
predicates:
- Path=/api/manage/**
filters:
- StripPrefix=2
# DSP小程序服务
- id: tuoheng-dsp-miniprogram
uri: lb://tuoheng-dsp-miniprogram
predicates:
- Path=/api/miniprogram/**
filters:
- StripPrefix=2
# DSP api服务
- id: tuoheng-dsp-api
uri: lb://tuoheng-dsp-api
predicates:
- Path=/api/web/**
filters:
- StripPrefix=2
# pilot后台管理
- id: tuoheng-pilot-admin
uri: lb://tuoheng-pilot-admin
predicates:
- Path=/pilot/admin/**
filters:
- StripPrefix=2
# pilot小程序服务
- id: tuoheng-pilot-miniprogram
uri: lb://tuoheng-pilot-miniprogram
predicates:
- Path=/pilot/miniprogram/**
filters:
- StripPrefix=2
# pilot api服务
- id: tuoheng-pilot-api
uri: lb://tuoheng-pilot-api
predicates:
- Path=/pilot/web/**
filters:
- StripPrefix=2
# oidc admin服务
- id: tuoheng-oidc-admin
uri: lb://tuoheng-oidc-admin
predicates:
- Path=/oidc/admin/**
filters:
- StripPrefix=2
# hhz admin服务
- id: tuoheng-hhz-admin
uri: lb://tuoheng-hhz-admin
predicates:
- Path=/hhz/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
database: 0
# Redis服务器地址
host: 192.168.11.13
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password:
# 连接超时时间(毫秒)
timeout: 6000
# 默认的数据过期时间,主要用于shiro权限管理
expire: 2592000
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 1 # 连接池中的最小空闲连接
#security放行白名单配置
security:
ignore:
permitUrls: /api/system/demo/msg
oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList

# 获取 apiUrl 可访问的 roleIdList
tuoheng:
hhz-admin-perUrl: http://192.168.11.22:9055/api/permission/getRoleIdList

+ 0
- 167
src/main/resources/application-local.yml 查看文件

@@ -1,167 +0,0 @@
spring:
security:
oauth2:
resource-server:
jwt:
issuer-uri: http://127.0.0.1:8090
cloud:
consul:
host: 127.0.0.1 # consul 所在服务地址
port: 8500 # consul 服务端口
discovery:
enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
## consul ip地址
hostname: 127.0.0.1
# 注册到consul的服务名称
service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
heartbeat:
enabled: true
prefer-ip-address: true #表示注册时使用IP而不是hostname
health-check-path: /actuator/health #健康检查
health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
health-check-timeout: 10s #健康检查超时
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
# 跨域设置
globalcors:
add-to-simple-url-handler-mapping: true
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:8001"
allowedMethods:
- "GET"
- "POST"
- "DELETE"
- "PUT"
- "OPTIONS"
allowedHeaders: "*"
allowCredentials: true
maxAge: 360000
routes:
# 认证中心
- id: tuoheng-auth
# 使用lb协议,tuoheng-auth是服务名
uri: lb://tuoheng-auth
# 断言
predicates:
- Path=/api/auth/**
# 去掉前缀前两级
filters:
- StripPrefix=2
# 系统模块
- id: tuoheng-dsp-system
uri: lb://tuoheng-dsp-system
predicates:
- Path=/api/system/**
filters:
- StripPrefix=2
# 代码生成器
- id: tuoheng-generator
uri: lb://tuoheng-generator
predicates:
- Path=/api/generator/**
filters:
- StripPrefix=2
# 后台管理
- id: tuoheng-admin
uri: lb://tuoheng-admin
predicates:
- Path=/api/admin/**
filters:
- StripPrefix=2
# - name: Hystrix
# args:
# name: fallbackcmd
# fallbackUri: forward:/fallback
# 网站服务
- id: tuoheng-portal
uri: lb://tuoheng-portal
predicates:
- Path=/api/portal/**
filters:
- StripPrefix=2
# DSP小程序服务
- id: tuoheng-dsp-miniprogram
uri: lb://tuoheng-dsp-miniprogram
predicates:
- Path=/api/miniprogram/**
filters:
- StripPrefix=2
# DSP api服务
- id: tuoheng-dsp-api
uri: lb://tuoheng-dsp-api
predicates:
- Path=/api/web/**
filters:
- StripPrefix=2
# pilot后台管理
- id: tuoheng-pilot-admin
uri: lb://tuoheng-pilot-admin
predicates:
- Path=/pilot/admin/**
filters:
- StripPrefix=2
# pilot小程序服务
- id: tuoheng-pilot-miniprogram
uri: lb://tuoheng-pilot-miniprogram
predicates:
- Path=/pilot/miniprogram/**
filters:
- StripPrefix=2
# pilot api服务
- id: tuoheng-pilot-api
uri: lb://tuoheng-pilot-api
predicates:
- Path=/pilot/web/**
filters:
- StripPrefix=2
# oidc admin服务
- id: tuoheng-oidc-admin
uri: lb://tuoheng-oidc-admin
predicates:
- Path=/oidc/admin/**
filters:
- StripPrefix=2
# hhz admin服务
- id: tuoheng-hhz-admin
uri: lb://tuoheng-hhz-admin
predicates:
- Path=/hhz/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
database: 0
# Redis服务器地址
host: 192.168.11.13
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password:
# 连接超时时间(毫秒)
timeout: 6000
# 默认的数据过期时间,主要用于shiro权限管理
expire: 2592000
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 1 # 连接池中的最小空闲连接
#security放行白名单配置
security:
ignore:
permitUrls: /api/system/demo/msg
oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList

# 获取 apiUrl 可访问的 roleIdList
tuoheng:
hhz-admin-perUrl: http://127.0.0.1:9055/api/permission/getRoleIdList

+ 0
- 161
src/main/resources/application-test.yml 查看文件

@@ -1,161 +0,0 @@
spring:
security:
oauth2:
resource-server:
jwt:
#issuer-uri: http://192.168.11.241:8090
issuer-uri: https://login-test.t-aaron.com
cloud:
consul:
host: 172.15.1.11 # consul 所在服务地址
port: 8500 # consul 服务端口
discovery:
enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
## consul ip地址
hostname: 172.15.1.11
# 注册到consul的服务名称
service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
heartbeat:
enabled: true
prefer-ip-address: true #表示注册时使用IP而不是hostname
health-check-path: /actuator/health #健康检查
health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
health-check-timeout: 10s #健康检查超时
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
# 跨域设置
globalcors:
add-to-simple-url-handler-mapping: true
cors-configurations:
'[/**]':
allowedOrigins:
- "http://localhost:8001"
allowedMethods:
- "GET"
- "POST"
- "DELETE"
- "PUT"
- "OPTIONS"
allowedHeaders: "*"
allowCredentials: true
maxAge: 360000
routes:
# 认证中心
- id: tuoheng-auth
uri: lb://tuoheng-auth
predicates:
- Path=/api/auth/**
filters:
- StripPrefix=2
# 系统模块
- id: tuoheng-dsp-system
uri: lb://tuoheng-dsp-system
predicates:
- Path=/api/system/**
filters:
- StripPrefix=2
# 代码生成器
- id: tuoheng-generator
uri: lb://tuoheng-generator
predicates:
- Path=/api/generator/**
filters:
- StripPrefix=2
# 后台管理
- id: tuoheng-dsp-admin
uri: lb://tuoheng-dsp-admin
predicates:
- Path=/api/admin/**
filters:
- StripPrefix=2
# 网站服务
- id: tuoheng-dsp-portal
uri: lb://tuoheng-dsp-portal
predicates:
- Path=/api/portal/**
filters:
- StripPrefix=2
# DSP小程序服务
- id: tuoheng-dsp-miniprogram
uri: lb://tuoheng-dsp-miniprogram
predicates:
- Path=/api/miniprogram/**
filters:
- StripPrefix=2
# DSP api服务
- id: tuoheng-dsp-api
uri: lb://tuoheng-dsp-api
predicates:
- Path=/api/web/**
filters:
- StripPrefix=2
# pilot后台管理
- id: tuoheng-pilot-admin
uri: lb://tuoheng-pilot-admin
predicates:
- Path=/pilot/admin/**
filters:
- StripPrefix=2
# pilot小程序服务
- id: tuoheng-pilot-miniprogram
uri: lb://tuoheng-pilot-miniprogram
predicates:
- Path=/pilot/miniprogram/**
filters:
- StripPrefix=2
# pilot api服务
- id: tuoheng-pilot-api
uri: lb://tuoheng-pilot-api
predicates:
- Path=/pilot/web/**
filters:
- StripPrefix=2
# oidc admin服务
- id: tuoheng-oidc-admin
uri: lb://tuoheng-oidc-admin
predicates:
- Path=/oidc/admin/**
filters:
- StripPrefix=2
# hhz admin服务
- id: tuoheng-hhz-admin
uri: lb://tuoheng-hhz-admin
predicates:
- Path=/hhz/admin/**
filters:
- StripPrefix=2
# Redis数据源
redis:
# 缓存库默认索引0
database: 0
# Redis服务器地址
host: r-uf6cdzjifj20jszykr.redis.rds.aliyuncs.com
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码(默认为空)
password:
# 连接超时时间(毫秒)
timeout: 6000
# 默认的数据过期时间,主要用于shiro权限管理
expire: 2592000
jedis:
pool:
max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
max-idle: 10 # 连接池中的最大空闲连接
min-idle: 1 # 连接池中的最小空闲连接
#security放行白名单配置
security:
ignore:
permitUrls: /api/system/demo/msg
oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList

# 获取 apiUrl 可访问的 roleIdList
tuoheng:
hhz-admin-perUrl: http://192.168.11.22:9055/api/permission/getRoleIdList

+ 180
- 0
src/main/resources/bootstrap-dev.yml 查看文件

@@ -0,0 +1,180 @@
spring:
cloud:
nacos:
discovery:
server-addr: 192.168.11.13:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
# 不注册到nacos
# register-enabled: false
config:
server-addr: 192.168.11.13:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
file-extension: yaml
#spring:
# security:
# oauth2:
# resource-server:
# jwt:
# issuer-uri: http://192.168.11.11:8090
# #issuer-uri: http://oidc.dev.t-aaron.com
# cloud:
# consul:
# host: 192.168.11.13 # consul 所在服务地址
# port: 8500 # consul 服务端口
# discovery:
# enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
# register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
# deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
# ## consul ip地址
# hostname: 192.168.11.13
# # 注册到consul的服务名称
# service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
# instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
# heartbeat:
# enabled: true
# prefer-ip-address: true #表示注册时使用IP而不是hostname
# health-check-path: /actuator/health #健康检查
# health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
# health-check-timeout: 10s #健康检查超时
# gateway:
# discovery:
# locator:
# lowerCaseServiceId: true
# enabled: true
# # 跨域设置
# globalcors:
# add-to-simple-url-handler-mapping: true
# cors-configurations:
# '[/**]':
# allowedOrigins:
# - "http://localhost:8001"
# allowedMethods:
# - "GET"
# - "POST"
# - "DELETE"
# - "PUT"
# - "OPTIONS"
# allowedHeaders: "*"
# allowCredentials: true
# maxAge: 360000
# routes:
# # 认证中心
# - id: tuoheng-auth
# uri: lb://tuoheng-auth
# predicates:
# - Path=/api/auth/**
# filters:
# - StripPrefix=2
# # 系统模块
# - id: tuoheng-dsp-system
# uri: lb://tuoheng-dsp-system
# predicates:
# - Path=/api/system/**
# filters:
# - StripPrefix=2
# # 代码生成器
# - id: tuoheng-generator
# uri: lb://tuoheng-generator
# predicates:
# - Path=/api/generator/**
# filters:
# - StripPrefix=2
# # 后台管理
# - id: tuoheng-dsp-admin
# uri: lb://tuoheng-dsp-admin
# predicates:
# - Path=/api/admin/**
# filters:
# - StripPrefix=2
# # 网站服务
# - id: tuoheng-dsp-portal
# uri: lb://tuoheng-dsp-portal
# predicates:
# - Path=/api/portal/**
# filters:
# - StripPrefix=2
# # 网站服务
# - id: tuoheng-manage
# uri: lb://tuoheng-manage
# predicates:
# - Path=/api/manage/**
# filters:
# - StripPrefix=2
# # DSP小程序服务
# - id: tuoheng-dsp-miniprogram
# uri: lb://tuoheng-dsp-miniprogram
# predicates:
# - Path=/api/miniprogram/**
# filters:
# - StripPrefix=2
# # DSP api服务
# - id: tuoheng-dsp-api
# uri: lb://tuoheng-dsp-api
# predicates:
# - Path=/api/web/**
# filters:
# - StripPrefix=2
# # pilot后台管理
# - id: tuoheng-pilot-admin
# uri: lb://tuoheng-pilot-admin
# predicates:
# - Path=/pilot/admin/**
# filters:
# - StripPrefix=2
# # pilot小程序服务
# - id: tuoheng-pilot-miniprogram
# uri: lb://tuoheng-pilot-miniprogram
# predicates:
# - Path=/pilot/miniprogram/**
# filters:
# - StripPrefix=2
# # pilot api服务
# - id: tuoheng-pilot-api
# uri: lb://tuoheng-pilot-api
# predicates:
# - Path=/pilot/web/**
# filters:
# - StripPrefix=2
# # oidc admin服务
# - id: tuoheng-oidc-admin
# uri: lb://tuoheng-oidc-admin
# predicates:
# - Path=/oidc/admin/**
# filters:
# - StripPrefix=2
# # hhz admin服务
# - id: tuoheng-hhz-admin
# uri: lb://tuoheng-hhz-admin
# predicates:
# - Path=/hhz/admin/**
# filters:
# - StripPrefix=2
# # Redis数据源
# redis:
# # 缓存库默认索引0
# database: 0
# # Redis服务器地址
# host: 192.168.11.13
# # Redis服务器连接端口
# port: 6379
# # Redis服务器连接密码(默认为空)
# password:
# # 连接超时时间(毫秒)
# timeout: 6000
# # 默认的数据过期时间,主要用于shiro权限管理
# expire: 2592000
# jedis:
# pool:
# max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
# max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
# max-idle: 10 # 连接池中的最大空闲连接
# min-idle: 1 # 连接池中的最小空闲连接
##security放行白名单配置
#security:
# ignore:
# permitUrls: /api/system/demo/msg
# oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList
#
## 获取 apiUrl 可访问的 roleIdList
#tuoheng:
# hhz-admin-perUrl: http://192.168.11.22:9055/api/permission/getRoleIdList

+ 179
- 0
src/main/resources/bootstrap-local.yml 查看文件

@@ -0,0 +1,179 @@
spring:
cloud:
nacos:
discovery:
server-addr: 192.168.11.13:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
# 不注册到nacos
# register-enabled: false
config:
server-addr: 192.168.11.13:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
file-extension: yaml
#spring:
# security:
# oauth2:
# resource-server:
# jwt:
# issuer-uri: http://127.0.0.1:8090
# cloud:
# consul:
# host: 127.0.0.1 # consul 所在服务地址
# port: 8500 # consul 服务端口
# discovery:
# enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
# register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
# deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
# ## consul ip地址
# hostname: 127.0.0.1
# # 注册到consul的服务名称
# service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
# instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
# heartbeat:
# enabled: true
# prefer-ip-address: true #表示注册时使用IP而不是hostname
# health-check-path: /actuator/health #健康检查
# health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
# health-check-timeout: 10s #健康检查超时
# gateway:
# discovery:
# locator:
# lowerCaseServiceId: true
# enabled: true
# # 跨域设置
# globalcors:
# add-to-simple-url-handler-mapping: true
# cors-configurations:
# '[/**]':
# allowedOrigins:
# - "http://localhost:8001"
# allowedMethods:
# - "GET"
# - "POST"
# - "DELETE"
# - "PUT"
# - "OPTIONS"
# allowedHeaders: "*"
# allowCredentials: true
# maxAge: 360000
# routes:
# # 认证中心
# - id: tuoheng-auth
# # 使用lb协议,tuoheng-auth是服务名
# uri: lb://tuoheng-auth
# # 断言
# predicates:
# - Path=/api/auth/**
# # 去掉前缀前两级
# filters:
# - StripPrefix=2
# # 系统模块
# - id: tuoheng-dsp-system
# uri: lb://tuoheng-dsp-system
# predicates:
# - Path=/api/system/**
# filters:
# - StripPrefix=2
# # 代码生成器
# - id: tuoheng-generator
# uri: lb://tuoheng-generator
# predicates:
# - Path=/api/generator/**
# filters:
# - StripPrefix=2
# # 后台管理
# - id: tuoheng-admin
# uri: lb://tuoheng-admin
# predicates:
# - Path=/api/admin/**
# filters:
# - StripPrefix=2
## - name: Hystrix
## args:
## name: fallbackcmd
## fallbackUri: forward:/fallback
# # 网站服务
# - id: tuoheng-portal
# uri: lb://tuoheng-portal
# predicates:
# - Path=/api/portal/**
# filters:
# - StripPrefix=2
# # DSP小程序服务
# - id: tuoheng-dsp-miniprogram
# uri: lb://tuoheng-dsp-miniprogram
# predicates:
# - Path=/api/miniprogram/**
# filters:
# - StripPrefix=2
# # DSP api服务
# - id: tuoheng-dsp-api
# uri: lb://tuoheng-dsp-api
# predicates:
# - Path=/api/web/**
# filters:
# - StripPrefix=2
# # pilot后台管理
# - id: tuoheng-pilot-admin
# uri: lb://tuoheng-pilot-admin
# predicates:
# - Path=/pilot/admin/**
# filters:
# - StripPrefix=2
# # pilot小程序服务
# - id: tuoheng-pilot-miniprogram
# uri: lb://tuoheng-pilot-miniprogram
# predicates:
# - Path=/pilot/miniprogram/**
# filters:
# - StripPrefix=2
# # pilot api服务
# - id: tuoheng-pilot-api
# uri: lb://tuoheng-pilot-api
# predicates:
# - Path=/pilot/web/**
# filters:
# - StripPrefix=2
# # oidc admin服务
# - id: tuoheng-oidc-admin
# uri: lb://tuoheng-oidc-admin
# predicates:
# - Path=/oidc/admin/**
# filters:
# - StripPrefix=2
# # hhz admin服务
# - id: tuoheng-hhz-admin
# uri: lb://tuoheng-hhz-admin
# predicates:
# - Path=/hhz/admin/**
# filters:
# - StripPrefix=2
# # Redis数据源
# redis:
# # 缓存库默认索引0
# database: 0
# # Redis服务器地址
# host: 192.168.11.13
# # Redis服务器连接端口
# port: 6379
# # Redis服务器连接密码(默认为空)
# password:
# # 连接超时时间(毫秒)
# timeout: 6000
# # 默认的数据过期时间,主要用于shiro权限管理
# expire: 2592000
# jedis:
# pool:
# max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
# max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
# max-idle: 10 # 连接池中的最大空闲连接
# min-idle: 1 # 连接池中的最小空闲连接
##security放行白名单配置
#security:
# ignore:
# permitUrls: /api/system/demo/msg
# oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList
#
## 获取 apiUrl 可访问的 roleIdList
#tuoheng:
# hhz-admin-perUrl: http://127.0.0.1:9055/api/permission/getRoleIdList

+ 173
- 0
src/main/resources/bootstrap-test.yml 查看文件

@@ -0,0 +1,173 @@
spring:
cloud:
nacos:
discovery:
server-addr: 106.15.64.139:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
# 不注册到nacos
# register-enabled: false
config:
server-addr: 106.15.64.139:28848
namespace: e8c51144-ed0e-4a0a-875b-5e512eea9318
file-extension: yaml
#spring:
# security:
# oauth2:
# resource-server:
# jwt:
# #issuer-uri: http://192.168.11.241:8090
# issuer-uri: https://login-test.t-aaron.com
# cloud:
# consul:
# host: 172.15.1.11 # consul 所在服务地址
# port: 8500 # consul 服务端口
# discovery:
# enabled: true #默认true。Consul Discovery Client是否注册到注册中心。和register同时设置成false,就不需要起consul服务。
# register: true #是否将服务注册到Consul集群中心.。这个参数和上面的enabled参数同时设置成false,应用才不会注册注册中心,才可以不起consul服务!
# deregister: true #默认true,服务停止时注销服务,即从服务列表中删除。设置成false的话,???
# ## consul ip地址
# hostname: 172.15.1.11
# # 注册到consul的服务名称
# service-name: ${spring.application.name} # 服务提供者名称,注册在consul上面的名字,在consul的调用中,是通过此名字调用的。默认服务名,不要改
# instance-id: ${spring.application.name}:${spring.cloud.client.ip-address}:${server.port} #实例ID
# heartbeat:
# enabled: true
# prefer-ip-address: true #表示注册时使用IP而不是hostname
# health-check-path: /actuator/health #健康检查
# health-check-interval: 10s #配置 Consul 健康检查频率,也就是心跳频率。
# health-check-timeout: 10s #健康检查超时
# gateway:
# discovery:
# locator:
# lowerCaseServiceId: true
# enabled: true
# # 跨域设置
# globalcors:
# add-to-simple-url-handler-mapping: true
# cors-configurations:
# '[/**]':
# allowedOrigins:
# - "http://localhost:8001"
# allowedMethods:
# - "GET"
# - "POST"
# - "DELETE"
# - "PUT"
# - "OPTIONS"
# allowedHeaders: "*"
# allowCredentials: true
# maxAge: 360000
# routes:
# # 认证中心
# - id: tuoheng-auth
# uri: lb://tuoheng-auth
# predicates:
# - Path=/api/auth/**
# filters:
# - StripPrefix=2
# # 系统模块
# - id: tuoheng-dsp-system
# uri: lb://tuoheng-dsp-system
# predicates:
# - Path=/api/system/**
# filters:
# - StripPrefix=2
# # 代码生成器
# - id: tuoheng-generator
# uri: lb://tuoheng-generator
# predicates:
# - Path=/api/generator/**
# filters:
# - StripPrefix=2
# # 后台管理
# - id: tuoheng-dsp-admin
# uri: lb://tuoheng-dsp-admin
# predicates:
# - Path=/api/admin/**
# filters:
# - StripPrefix=2
# # 网站服务
# - id: tuoheng-dsp-portal
# uri: lb://tuoheng-dsp-portal
# predicates:
# - Path=/api/portal/**
# filters:
# - StripPrefix=2
# # DSP小程序服务
# - id: tuoheng-dsp-miniprogram
# uri: lb://tuoheng-dsp-miniprogram
# predicates:
# - Path=/api/miniprogram/**
# filters:
# - StripPrefix=2
# # DSP api服务
# - id: tuoheng-dsp-api
# uri: lb://tuoheng-dsp-api
# predicates:
# - Path=/api/web/**
# filters:
# - StripPrefix=2
# # pilot后台管理
# - id: tuoheng-pilot-admin
# uri: lb://tuoheng-pilot-admin
# predicates:
# - Path=/pilot/admin/**
# filters:
# - StripPrefix=2
# # pilot小程序服务
# - id: tuoheng-pilot-miniprogram
# uri: lb://tuoheng-pilot-miniprogram
# predicates:
# - Path=/pilot/miniprogram/**
# filters:
# - StripPrefix=2
# # pilot api服务
# - id: tuoheng-pilot-api
# uri: lb://tuoheng-pilot-api
# predicates:
# - Path=/pilot/web/**
# filters:
# - StripPrefix=2
# # oidc admin服务
# - id: tuoheng-oidc-admin
# uri: lb://tuoheng-oidc-admin
# predicates:
# - Path=/oidc/admin/**
# filters:
# - StripPrefix=2
# # hhz admin服务
# - id: tuoheng-hhz-admin
# uri: lb://tuoheng-hhz-admin
# predicates:
# - Path=/hhz/admin/**
# filters:
# - StripPrefix=2
# # Redis数据源
# redis:
# # 缓存库默认索引0
# database: 0
# # Redis服务器地址
# host: r-uf6cdzjifj20jszykr.redis.rds.aliyuncs.com
# # Redis服务器连接端口
# port: 6379
# # Redis服务器连接密码(默认为空)
# password:
# # 连接超时时间(毫秒)
# timeout: 6000
# # 默认的数据过期时间,主要用于shiro权限管理
# expire: 2592000
# jedis:
# pool:
# max-active: 1000 # 连接池最大连接数(使用负值表示没有限制)
# max-wait: -1 # 连接池最大阻塞等待时间(使用负值表示没有限制)
# max-idle: 10 # 连接池中的最大空闲连接
# min-idle: 1 # 连接池中的最小空闲连接
##security放行白名单配置
#security:
# ignore:
# permitUrls: /api/system/demo/msg
# oauthUrls: /api/system/demo/hello,/api/*/serviceInst/*/getServiceInstParam/*,/api/*/serviceInst/*/getServiceInstCaseUrl/*,/api/*/serviceInst/*/*/application,/api/*/serviceInst/*/*/questionList
#
## 获取 apiUrl 可访问的 roleIdList
#tuoheng:
# hhz-admin-perUrl: http://192.168.11.22:9055/api/permission/getRoleIdList

src/main/resources/application.yml → src/main/resources/bootstrap.yml 查看文件


Loading…
取消
儲存