diff --git a/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts b/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts index f673cc8..254ca75 100644 --- a/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts +++ b/backend/services/admin-service/src/interface/http/controllers/admin-version.controller.ts @@ -101,6 +101,9 @@ export class AdminVersionController { }, @Req() req: any, ) { + if (!file) { + return { code: 400, message: 'No file uploaded — check Content-Type boundary' }; + } // Parse package to extract metadata (auto-fill when not provided) const parsedInfo = await this.packageParser.parse(file.buffer, file.originalname); @@ -152,6 +155,9 @@ export class AdminVersionController { @ApiConsumes('multipart/form-data') @ApiOperation({ summary: 'Parse APK/IPA without saving (preview metadata)' }) async parsePackage(@UploadedFile() file: Express.Multer.File) { + if (!file) { + return { code: 400, message: 'No file uploaded — check Content-Type boundary' }; + } const info = await this.packageParser.parse(file.buffer, file.originalname); return { code: 0, data: info }; } diff --git a/frontend/admin-web/src/views/app-versions/AppVersionManagementPage.tsx b/frontend/admin-web/src/views/app-versions/AppVersionManagementPage.tsx index 7541263..5123a57 100644 --- a/frontend/admin-web/src/views/app-versions/AppVersionManagementPage.tsx +++ b/frontend/admin-web/src/views/app-versions/AppVersionManagementPage.tsx @@ -325,7 +325,6 @@ const UploadModal: React.FC<{ const info = await apiClient.post<{ versionCode?: number; versionName?: string; minSdkVersion?: string; }>('/api/v1/admin/versions/parse', formData, { - headers: { 'Content-Type': 'multipart/form-data' }, timeout: 300000, }); console.log('[Upload] Parse result:', info); @@ -359,7 +358,6 @@ const UploadModal: React.FC<{ formData.append('isForceUpdate', String(isForceUpdate)); const result = await apiClient.post('/api/v1/admin/versions/upload', formData, { - headers: { 'Content-Type': 'multipart/form-data' }, timeout: 300000, }); console.log('[Upload] Success:', result);