From 08bd8915c5c76611c1584a59ca6c01a0335c7343 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 3 Sep 2026 18:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B5=B0=E6=9F=A5=E5=8F=91=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E7=AC=AC=E4=BA=94=E6=89=B9=EF=BC=9A=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=8A=B6=E6=80=81=E3=80=81=E6=97=A5=E6=8A=A5?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E3=80=81client=5Fcontext=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - content-library-view: 收藏列表的 FileCard 一直没传 removed,需求 7.3「失效文件需展示明确 状态而非直接报错」在收藏页就没生效(聊天记录页本来就传了,只有这条漏了)。后端 messageAvailability 在源消息被删/撤回时给 'removed'。 - workplace-collaboration-view: 日报"团队统计"的搜索占位符写着"搜索姓名/部门",但过滤用的 department_name 后端根本不返回(dailyReportListPayload 只有 report_id/author_id/report_date/ content_short/status/draft_updated_at/read_state/version),拼进来恒为空串,"部门"那半个 搜索永远搜不到任何东西。改为按真实有的字段搜(姓名+摘要),占位符也改成如实的; 卡片上同样读了这个不存在字段的角色徽章一并改掉。 - im-api: 企业注册申请 / 入口反馈 / 意见反馈三个接口后端都定义了 client_context 且会入库 (im_http.go:255/263/367,落库点 :790/:840/:1478),需求与对接文档也都要求带设备版本信息, 前端一直没发。在 im-api 层统一注入,三处调用点不用各写一遍。navigator.connection 不是所有 浏览器都有,拿不到就不发 network 这一项。 已用真实提交验证(返回 fb_G9GtMsAbSHQ6z6Li)。 Co-Authored-By: Claude Opus 5 --- src/lib/im-api.js | 23 +++++++++++++--- src/views/content-library-view.jsx | 6 ++++- src/views/workplace-collaboration-view.jsx | 9 ++++--- umd/index.dev.js | 31 +++++++++++++++++----- umd/index.dev.js.map | 2 +- 5 files changed, 57 insertions(+), 14 deletions(-) diff --git a/src/lib/im-api.js b/src/lib/im-api.js index 8a69c3d5..a66841af 100644 --- a/src/lib/im-api.js +++ b/src/lib/im-api.js @@ -351,12 +351,29 @@ export function resolveTenant(tenantCode) { }); } +// 企业注册申请 / 入口反馈 / 意见反馈三个接口后端都定义了 client_context 且会入库 +// (imTenantApplicationRequest / imTenantEntryFeedbackRequest / imFeedbackRequest, +// server/im_http.go:255/263/367,落库点 :790/:840/:1478),需求文档和对接文档也都要求带上 +// 设备与版本信息。前端一直没发。在这里统一注入,省得三处各写一遍、也不会再漏。 +function clientContext() { + return { + platform: 'web', + app_version: PACKAGE_VERSION || '', + user_agent: (typeof navigator !== 'undefined' && navigator.userAgent) || '', + language: (typeof navigator !== 'undefined' && navigator.language) || '', + // 网络类型不是所有浏览器都有(Safari/Firefox 没有 navigator.connection),拿不到就不发这一项 + network: (typeof navigator !== 'undefined' && navigator.connection && navigator.connection.effectiveType) || undefined + }; +} + export function submitTenantApplication(body) { - return imRequest('/tenant-applications', {method: 'POST', auth: false, headers: idem(), body}); + return imRequest('/tenant-applications', {method: 'POST', auth: false, headers: idem(), + body: {client_context: clientContext(), ...body}}); } export function submitTenantEntryFeedback(body) { - return imRequest('/tenant-entry-feedback', {method: 'POST', auth: false, headers: idem(), body}); + return imRequest('/tenant-entry-feedback', {method: 'POST', auth: false, headers: idem(), + body: {client_context: clientContext(), ...body}}); } // -- 1.4/1.5/1.6 Phone verification codes (register / reset_password / security scenes). -- @@ -697,4 +714,4 @@ export const updateDevicePushToken = (deviceId, body) => imPut('/devices/' + enc export const getAbuseReasons = (targetType = 'user') => imGet('/reports/abuse/reasons' + qs({target_type: targetType})); export const submitAbuseReport = body => imPost('/reports/abuse', body); export const getFeedbackConfig = () => imGet('/feedback/config'); -export const submitFeedback = body => imPost('/feedback', body); +export const submitFeedback = body => imPost('/feedback', {client_context: clientContext(), ...body}); diff --git a/src/views/content-library-view.jsx b/src/views/content-library-view.jsx index 3a522fea..48563397 100644 --- a/src/views/content-library-view.jsx +++ b/src/views/content-library-view.jsx @@ -157,7 +157,11 @@ function FavoriteItem({item, onOpen, selecting, selected, onSelect}) { {selecting ? : null}
{item.type === 'text' ?

{plainTextOf(item.snapshot && item.snapshot.content, item.snapshot && item.snapshot.text)}

: null} - {item.type === 'file' ? : null} + {/* removed 一直没传,需求 7.3「失效文件需展示明确状态而非直接报错」在收藏列表里就没生效—— + 聊天记录页(下面 history-files 那处)本来就传了,只有收藏这条漏了。后端 + messageAvailability(im_http.go:9113)在源消息被删/被撤回时给 'removed'。 */} + {item.type === 'file' ? : null} {item.type === 'voice' ? : null} {item.type === 'link' ? : null} {item.type === 'image' || item.type === 'video' ? : null} diff --git a/src/views/workplace-collaboration-view.jsx b/src/views/workplace-collaboration-view.jsx index c06eb532..d9f84ca4 100644 --- a/src/views/workplace-collaboration-view.jsx +++ b/src/views/workplace-collaboration-view.jsx @@ -652,7 +652,7 @@ const STATUS_LABEL = {submitted: '已提交', draft: '未提交'}; function DailyReportCard({report, names, team}) { return
-
{names[report.author_id] || report.author_id}{team ? (report.department_name || '员工') : '员工'} +
{names[report.author_id] || report.author_id}员工 {STATUS_LABEL[report.status] || report.status}

{report.content_short || '(未填写内容)'}