2024-01-21 17:37:03 +08:00
|
|
|
|
server:
|
|
|
|
|
|
port: 8080
|
|
|
|
|
|
|
|
|
|
|
|
spring:
|
|
|
|
|
|
application:
|
|
|
|
|
|
name: api-service
|
2024-01-21 18:46:58 +08:00
|
|
|
|
security:
|
|
|
|
|
|
user:
|
|
|
|
|
|
name: admin
|
|
|
|
|
|
password: password
|
|
|
|
|
|
basic:
|
|
|
|
|
|
enabled: true
|
2024-01-21 17:37:03 +08:00
|
|
|
|
cloud:
|
|
|
|
|
|
nacos:
|
|
|
|
|
|
discovery:
|
|
|
|
|
|
server-addr: 127.0.0.1:8848
|
2024-01-21 18:18:09 +08:00
|
|
|
|
# username: nacos
|
|
|
|
|
|
# password: nacos
|
2024-01-21 17:37:03 +08:00
|
|
|
|
gateway:
|
|
|
|
|
|
discovery:
|
|
|
|
|
|
locator:
|
|
|
|
|
|
enabled: true
|
|
|
|
|
|
routes:
|
|
|
|
|
|
- id: tao_oms_route
|
|
|
|
|
|
uri: lb://tao-oms # lb 表示从 nacos 中按照名称获取微服务,并遵循负载均衡策略,user-service 对应用户微服务应用名
|
|
|
|
|
|
predicates:
|
2024-01-21 18:46:58 +08:00
|
|
|
|
- Path=/tao-service/** # 使用断言
|
2024-01-21 17:37:03 +08:00
|
|
|
|
filters:
|
2024-01-21 18:46:58 +08:00
|
|
|
|
- StripPrefix=1 # 使用过滤器
|
|
|
|
|
|
# - name: Security # 添加安全过滤器
|
|
|
|
|
|
# args:
|
|
|
|
|
|
# springSecurityFilterChain: # 配置Spring Security过滤器链
|
|
|
|
|
|
# order: 0
|
|
|
|
|
|
# securityMatcher: org.springframework.security.web.util.matcher.AntPathRequestMatcher
|
|
|
|
|
|
# securityFilter: org.springframework.security.web.server.SecurityWebFilterChainFilter
|
|
|
|
|
|
# securityContextRepository: org.springframework.security.web.server.context.ServerSecurityContextRepository
|
|
|
|
|
|
# serverAccessDeniedHandler: org.springframework.security.web.server.access.AccessDeniedHandlerImpl
|
|
|
|
|
|
# serverAuthenticationEntryPoint: org.springframework.security.web.server.authentication.BasicAuthenticationEntryPoint
|
|
|
|
|
|
|
|
|
|
|
|
## 授权规则
|
|
|
|
|
|
#security:
|
|
|
|
|
|
# rules:
|
|
|
|
|
|
# - pattern: /api/tao-service/** # 定义需要授权的URL模式
|