fix(traefik/consul): 统一路径规则语法并更新API路径前缀配置

将Traefik路由规则中的路径语法从反引号(`)改为双引号(")以保持一致性
同时将traefik.yml中的pathPrefix改为pathPrefixes以支持数组格式
This commit is contained in:
fanfpy 2025-07-02 17:37:18 +08:00
parent cebc343893
commit 6ecb0603bb
8 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,7 @@
"id": "data-service-1", "id": "data-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.data-service.rule=PathPrefix(`/api/data`)", "traefik.http.routers.data-service.rule=PathPrefix(\"/api/data\")",
"traefik.http.routers.data-service.entrypoints=web" "traefik.http.routers.data-service.entrypoints=web"
], ],
"name": "data-service", "name": "data-service",

View File

@ -9,7 +9,7 @@
"id": "emotion-service-1", "id": "emotion-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.emotion-service.rule=PathPrefix(`/api/emotion`)", "traefik.http.routers.emotion-service.rule=PathPrefix(\"/api/emotion\")",
"traefik.http.routers.emotion-service.entrypoints=web" "traefik.http.routers.emotion-service.entrypoints=web"
], ],
"name": "emotion-service", "name": "emotion-service",

View File

@ -9,7 +9,7 @@
"id": "frontend-1", "id": "frontend-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.frontend.rule=PathPrefix(`/frontend`)", "traefik.http.routers.frontend.rule=PathPrefix(\"/frontend\")",
"traefik.http.routers.frontend.entrypoints=web" "traefik.http.routers.frontend.entrypoints=web"
], ],
"name": "frontend", "name": "frontend",

View File

@ -9,7 +9,7 @@
"id": "quant-service-1", "id": "quant-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.quant-service.rule=PathPrefix(`/api/quant`)", "traefik.http.routers.quant-service.rule=PathPrefix(\"/api/quant\")",
"traefik.http.routers.quant-service.entrypoints=web" "traefik.http.routers.quant-service.entrypoints=web"
], ],
"name": "quant-service", "name": "quant-service",

View File

@ -9,7 +9,7 @@
"id": "recommend-service-1", "id": "recommend-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.recommend-service.rule=PathPrefix(`/api/recommend`)", "traefik.http.routers.recommend-service.rule=PathPrefix(\"/api/recommend\")",
"traefik.http.routers.recommend-service.entrypoints=web" "traefik.http.routers.recommend-service.entrypoints=web"
], ],
"name": "recommend-service", "name": "recommend-service",

View File

@ -9,7 +9,7 @@
"id": "user-service-1", "id": "user-service-1",
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.user-service.rule=PathPrefix(`/api/user`)", "traefik.http.routers.user-service.rule=PathPrefix(\"/api/user\")",
"traefik.http.routers.user-service.entrypoints=web" "traefik.http.routers.user-service.entrypoints=web"
], ],
"name": "user-service", "name": "user-service",

View File

@ -4,7 +4,7 @@
"tags": [ "tags": [
"traefik.enable=true", "traefik.enable=true",
"traefik.http.routers.whoami.entrypoints=web", "traefik.http.routers.whoami.entrypoints=web",
"traefik.http.routers.whoami.rule=Path(`/whoami`)", "traefik.http.routers.whoami.rule=Path(\"/whoami\")",
"traefik.http.services.whoami.loadbalancer.server.port=80" "traefik.http.services.whoami.loadbalancer.server.port=80"
], ],
"address": "whoami", "address": "whoami",

View File

@ -12,4 +12,4 @@ providers:
api: api:
dashboard: true dashboard: true
insecure: true insecure: true
pathPrefix: "/traefik-api" pathPrefixes: ["/traefik-api"]