51 lines
1.6 KiB
YAML
51 lines
1.6 KiB
YAML
server:
|
|
port: 8080
|
|
spring:
|
|
application:
|
|
name: api-service
|
|
# security:
|
|
# user:
|
|
# name: admin
|
|
# password: password
|
|
basic:
|
|
enabled: true
|
|
cloud:
|
|
nacos:
|
|
discovery:
|
|
server-addr: 127.0.0.1:8848
|
|
# username: nacos
|
|
# password: nacos
|
|
gateway:
|
|
discovery:
|
|
locator:
|
|
enabled: true
|
|
routes:
|
|
- id: tao_api_route
|
|
uri: lb://tao-api
|
|
predicates:
|
|
- Path=/api/tao-api/**
|
|
filters:
|
|
- StripPrefix=2
|
|
- id: sys_api_route
|
|
uri: lb://sys-api
|
|
predicates:
|
|
- Path=/api/sys-api/**
|
|
filters:
|
|
- StripPrefix=2
|
|
# - TokenFilter
|
|
# default-filters:
|
|
# - TokenFilter
|
|
# - 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模式 |