fix(web): 第9轮审查批次2——群聊域一批问题

- 建群留空群名字直接被后端拒绝:placeholder写的"未填写时默认为成员
  昵称组合"从未真正实现,现在留空时用已选成员昵称拼接生成默认名,
  按MAX_TITLE_LENGTH截断
- 群文件上传按钮不受"群文件上传权限"治理开关约束:新增canUpload
  (和canInvite同一个算法),仅管理员时非管理员看不到上传入口
- 群管理弹层5个治理开关(进群验证/全员禁言/文件上传/私聊权限/邀请
  权限)都没有读取后端返回的对应_editable字段,现在全部接上
- 禁言成员列表只拉第一页:新增getAllGroupMutes复用fetchAllPages,
  和getAllGroupMembers同一个模式,人数多的群不会再静默截断
- 添加管理员没有前端数量上限校验:达到上限时按钮禁用并提示"已达
  管理员人数上限",不再让用户选完人才被后端拒绝
- 清空聊天记录没有错误处理,失败时静默无提示,现在补上

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-09-16 12:37:46 +08:00
co-authored by Claude Sonnet 5
parent ab96ae1fee
commit 8f4b0de636
5 changed files with 75 additions and 25 deletions
+8
View File
@@ -252,6 +252,14 @@ export function getGroupMutes(topic: string, cursor = '') {
return imGet<{ items: GroupMute[]; next_cursor?: string }>(`/groups/${encodeURIComponent(topic)}/mutes${cursor ? `?cursor=${cursor}` : ''}`);
}
/** `getGroupMutes` alone only ever reads the first page -- unlike `getAllGroupMembers`'s own
* `fetchAllPages` wrapper right above, GroupAdminModal's mutes view called the single-page
* function directly, silently truncating both the list and its own header count once a group has
* enough muted members to span more than one page. */
export function getAllGroupMutes(topic: string) {
return fetchAllPages((cursor) => getGroupMutes(topic, cursor));
}
export function unmuteGroupMember(topic: string, userId: string) {
return imDelete<{ user_id: string; muted: boolean }>(`/groups/${encodeURIComponent(topic)}/mutes/${encodeURIComponent(userId)}`);
}