diff --git a/backend/services/authorization-service/src/infrastructure/external/identity-service.client.ts b/backend/services/authorization-service/src/infrastructure/external/identity-service.client.ts index f6dc32fd..79e44c49 100644 --- a/backend/services/authorization-service/src/infrastructure/external/identity-service.client.ts +++ b/backend/services/authorization-service/src/infrastructure/external/identity-service.client.ts @@ -54,13 +54,15 @@ export class IdentityServiceClient implements OnModuleInit { try { this.logger.debug(`[HTTP] POST /internal/users/batch - ${accountSequences.length} users`); - const response = await this.httpClient.post( + const response = await this.httpClient.post<{ success: boolean; data: UserInfo[] }>( `/api/v1/internal/users/batch`, { accountSequences }, ); - if (response.data && Array.isArray(response.data)) { - for (const user of response.data) { + // identity-service 使用 TransformInterceptor 包装响应为 { success, data } + const users = response.data?.data || response.data; + if (users && Array.isArray(users)) { + for (const user of users) { result.set(user.accountSequence, user); } }