修复了点击联系人信息发送消息的时候房间id绑定问题

This commit is contained in:
2025-12-04 10:09:01 +08:00
parent 47fac373b7
commit f54a103de5
6 changed files with 35 additions and 7 deletions

View File

@@ -58,8 +58,16 @@ export function deleteGroup(id: number) {
}
// 获取好友详情
export function getContactDetail(id: string) {
return request.get<Contact>(`/contacts/${id}`)
export async function getContactDetail(id: string): Promise<Contact> {
const response = await request.get<{ contact: any; user: User }>(`/contacts/${id}`)
// 合并 contact 和 user 数据为完整的 Contact 对象
return {
...response.contact,
id: response.contact.id?.toString() || response.contact.contact_id,
user_id: response.contact.contact_id || response.contact.user_id,
contact_user_id: response.contact.contact_id,
user: response.user,
} as Contact
}
// 更新好友信息