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 || '(未填写内容)'}