diff --git a/Jenkinsfile b/Jenkinsfile index 7f335f9..95e180e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -238,7 +238,7 @@ services: image: timeline-registry:5000/timeline-gateway-service:${buildNumber} container_name: timeline-gateway-service ports: - - "30000:30000" + - "33333:30000" environment: - server.port=30000 - spring.cloud.gateway.routes[0].id=story-service diff --git a/timeline-gateway-service/src/main/resources/application.properties b/timeline-gateway-service/src/main/resources/application.properties index 87367c3..022289e 100644 --- a/timeline-gateway-service/src/main/resources/application.properties +++ b/timeline-gateway-service/src/main/resources/application.properties @@ -7,7 +7,7 @@ spring.datasource.username=root spring.datasource.password=WoCloud@9ol7uj spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -# 路由配置 +# spring.cloud.gateway.routes[0].id=story-service spring.cloud.gateway.routes[0].uri=http://localhost:30001 spring.cloud.gateway.routes[0].predicates[0]=Path=/story/** @@ -18,17 +18,20 @@ spring.cloud.gateway.routes[1].uri=http://localhost:30002 spring.cloud.gateway.routes[1].predicates[0]=Path=/file/** spring.cloud.gateway.routes[1].filters[0]=StripPrefix=0 -spring.cloud.gateway.routes[2].id=user-service +spring.cloud.gateway.routes[2].id=user-service-ws spring.cloud.gateway.routes[2].uri=http://localhost:30003 -spring.cloud.gateway.routes[2].predicates[0]=Path=/user/** +spring.cloud.gateway.routes[2].predicates[0]=Path=/user/ws/** spring.cloud.gateway.routes[2].filters[0]=StripPrefix=0 -# 添加WebSocket路由配置 -spring.cloud.gateway.routes[3].id=user-service-ws + +spring.cloud.gateway.routes[3].id=user-service spring.cloud.gateway.routes[3].uri=http://localhost:30003 -spring.cloud.gateway.routes[3].predicates[0]=Path=/user/ws/** +spring.cloud.gateway.routes[3].predicates[0]=Path=/user/** spring.cloud.gateway.routes[3].filters[0]=StripPrefix=0 + + + # JWT配置 jwt.secret=6f3f9c2b9d9a4e3f8c0d6a7b5c4e3f1a6f3f9c2b9d9a4e3f8c0d6a7b5c4e3f1a jwt.expiration=86400 @@ -45,4 +48,4 @@ management.endpoint.health.show-details=always # 日志配置 logging.level.org.springframework.cloud.gateway=DEBUG -logging.level.com.timeline.gateway=DEBUG \ No newline at end of file +logging.level.com.timeline.gateway=DEBUG