fix(groups): /api/groups加room_id精确直查(群聊页群名解析,修page_size=200超限422)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,8 @@ export interface GroupQuery {
|
||||
channel?: Channel | 'all'
|
||||
owner_account_id?: string
|
||||
user_id?: string
|
||||
/** 精确单行直查(群聊页群名解析)。 */
|
||||
room_id?: string
|
||||
page?: number
|
||||
page_size?: number
|
||||
}
|
||||
@@ -151,6 +153,7 @@ export function getGroups(query: GroupQuery = {}): Promise<Page<Group>> {
|
||||
channel: query.channel === 'all' ? undefined : query.channel,
|
||||
owner_account_id: query.owner_account_id,
|
||||
user_id: query.user_id,
|
||||
room_id: query.room_id,
|
||||
page: query.page ?? 1,
|
||||
page_size: query.page_size ?? 20,
|
||||
}),
|
||||
|
||||
@@ -76,10 +76,9 @@ async function loadTalkerName(): Promise<void> {
|
||||
if (!hasActive.value) return
|
||||
try {
|
||||
if (isGroup.value && props.roomId) {
|
||||
// 群名
|
||||
const res = await getGroups({ channel: channelTyped.value, owner_account_id: props.ownerId, page: 1, page_size: 200 })
|
||||
const g = res.items.find(g => g.room_id === props.roomId)
|
||||
talkerName.value = g?.room_name || null
|
||||
// 群名(room_id 精确单行直查,不再拉整页群列表)
|
||||
const res = await getGroups({ channel: channelTyped.value, room_id: props.roomId, page: 1, page_size: 1 })
|
||||
talkerName.value = res.items[0]?.room_name || null
|
||||
} else if (props.talkerId) {
|
||||
// 客户昵称
|
||||
const res = await getCustomers({
|
||||
|
||||
Reference in New Issue
Block a user