fix(app-assets): 修复公开API路径双重前缀 + Kong网关路由缺失

问题:移动端配置的开屏图/引导图无效
根因:
1. PublicAppAssetController 和 PublicSystemConfigController 的
   @Controller('api/v1/xxx') 与 NestJS 全局前缀 api/v1 叠加,
   导致实际端点为 api/v1/api/v1/xxx(双重前缀)
2. Kong 网关缺少 /api/v1/app-assets 和 /api/v1/system-config 路由
3. Flutter 端使用 /admin-service/api/v1/xxx 路径,不匹配任何 Kong 路由

修复:
- 后端:Controller 路径去掉 api/v1 前缀,由全局前缀统一添加
- Kong:新增 admin-app-assets-public 和 admin-system-config-public 路由
- Flutter:API 路径改为 /app-assets 和 /system-config/display/settings

受影响文件:
- backend/api-gateway/kong.yml (新增2条路由)
- backend/.../app-asset.controller.ts (Controller路径修正)
- backend/.../system-config.controller.ts (Controller路径修正)
- frontend/.../app_asset_service.dart (API路径修正)
- frontend/.../system_config_service.dart (API路径修正)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-05 04:36:53 -08:00
parent cba7ff590a
commit 34ba209e44
5 changed files with 12 additions and 4 deletions

View File

@ -228,6 +228,14 @@ services:
paths:
- /api/v1/mobile/system
strip_path: false
- name: admin-app-assets-public
paths:
- /api/v1/app-assets
strip_path: false
- name: admin-system-config-public
paths:
- /api/v1/system-config
strip_path: false
# ---------------------------------------------------------------------------
# Presence Service - 在线状态服务

View File

@ -229,7 +229,7 @@ export class AdminAppAssetController {
// =============================================================================
@ApiTags('App Assets (Public)')
@Controller('api/v1/app-assets')
@Controller('app-assets')
export class PublicAppAssetController {
constructor(private readonly prisma: PrismaService) {}

View File

@ -173,7 +173,7 @@ export class AdminSystemConfigController {
* /
* mobile-app
*/
@Controller('api/v1/system-config')
@Controller('system-config')
export class PublicSystemConfigController {
constructor(
@Inject(SYSTEM_CONFIG_REPOSITORY)

View File

@ -179,7 +179,7 @@ class AppAssetService {
Future<AppAssetConfig?> _fetchFromApi() async {
try {
final response = await _apiClient.get(
'/admin-service/api/v1/app-assets',
'/app-assets',
);
if (response.data is List) {
return AppAssetConfig.fromList(response.data as List);

View File

@ -77,7 +77,7 @@ class SystemConfigService {
try {
final response = await _apiClient.get(
'/admin-service/api/v1/system-config/display/settings',
'/system-config/display/settings',
);
_cachedDisplaySettings = DisplaySettings.fromJson(response.data);