From 6f87be4454ae9f748a6aa97ad245cdc6e79b1773 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 3 Mar 2026 07:37:44 -0800 Subject: [PATCH] =?UTF-8?q?fix(admin-service):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=85=AC=E5=BC=80=20API=20=E8=B7=AF=E7=94=B1=E5=89=8D=E7=BC=80?= =?UTF-8?q?=E6=8E=92=E9=99=A4=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setGlobalPrefix exclude 应匹配 controller 路径而非完整 URL。 修复前: exclude: ['api/app/version/(.*)'] → 不生效,公开 API 被加上 /api/v1 前缀 → 移动端需访问 /api/v1/app/version/check (错误) 修复后: exclude: ['app/version/(.*)'] → 正确排除 AppVersionController 的路由 → 移动端访问 /api/app/version/check (无 /api/v1 前缀) → 管理端继续使用 /api/v1/admin/versions (不受影响) Co-Authored-By: Claude Opus 4.6 --- backend/services/admin-service/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/admin-service/src/main.ts b/backend/services/admin-service/src/main.ts index 12efcc1..87900a2 100644 --- a/backend/services/admin-service/src/main.ts +++ b/backend/services/admin-service/src/main.ts @@ -8,7 +8,7 @@ async function bootstrap() { // Global prefix for admin APIs; mobile client endpoints excluded app.setGlobalPrefix('api/v1', { - exclude: ['api/app/version/(.*)'], + exclude: ['app/version/(.*)'], }); app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));