修复了点击联系人信息发送消息的时候房间id绑定问题
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
// 更新好友信息
|
||||
|
||||
Reference in New Issue
Block a user