fix(authorization-service): 修复 identity-service 响应解析

- 处理 TransformInterceptor 包装的响应格式 { success, data }
- 正确提取 data 字段中的用户信息

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-23 03:12:58 -08:00
parent 136c831922
commit b04dd1f234
1 changed files with 5 additions and 3 deletions

View File

@ -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<UserInfo[]>(
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);
}
}