From a1907f18a8d60a3e2ccab930239a51541422e553 Mon Sep 17 00:00:00 2001 From: xcbyy <2578898740@qq.com> Date: Sat, 31 Oct 2026 10:59:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(community):=20=E4=BF=AE=E5=A4=8D=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=8A=A8=E6=80=81=E5=88=B7=E6=96=B0=E5=90=8E=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=B6=88=E5=A4=B1=E3=80=81=E7=82=B9=E5=87=BB=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E8=AF=AF=E8=B7=B3=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - getPosts 客户端字段映射遗漏 videoUrl/videoCover,onShow 重新拉取后视频被丢弃 - 视频区域与播放器增加 catchtap 阻止冒泡,点击播放不再跳转详情页 - 顺带修正 uploadMediaFile 上方注释块错位 --- pwuniapp/common/api.js | 6 ++++-- pwuniapp/pages/community/index.vue | 3 ++- server/tests/community-video.spec.ts | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pwuniapp/common/api.js b/pwuniapp/common/api.js index 7dddddb..0760bed 100644 --- a/pwuniapp/common/api.js +++ b/pwuniapp/common/api.js @@ -575,6 +575,8 @@ export async function getPosts(category, userId) { content: p.content || '', topics: Array.isArray(p.topics) ? p.topics : [], images: Array.isArray(p.images) ? p.images : [], + videoUrl: p.videoUrl || '', + videoCover: p.videoCover || '', actionText: p.actionText || '聊一聊', likes: Number(p.likes) || 0, liked: finalLiked || isLocallyLiked, @@ -1081,8 +1083,6 @@ function uploadMediaFile(tempFilePath, endpoint, kindLabel) { }); } -/** - * 客户端前端前置检测文本安全 (对接 security.msgSecCheck) /** * 真实上传本地图片至服务端持久化静态存储 * @param {string} tempFilePath 本地图片临时路径 @@ -1102,6 +1102,8 @@ export function uploadVideo(tempFilePath) { } +/** + * 客户端前端前置检测文本安全 (对接 security.msgSecCheck) */ export async function checkTextSecurity(content) { try { diff --git a/pwuniapp/pages/community/index.vue b/pwuniapp/pages/community/index.vue index e8f0d4e..fd9571d 100644 --- a/pwuniapp/pages/community/index.vue +++ b/pwuniapp/pages/community/index.vue @@ -124,7 +124,7 @@ - + diff --git a/server/tests/community-video.spec.ts b/server/tests/community-video.spec.ts index 5fd754a..90a1462 100644 --- a/server/tests/community-video.spec.ts +++ b/server/tests/community-video.spec.ts @@ -56,6 +56,12 @@ describe('友圈短视频发布链路', () => { expect(detail).toContain('post.videoUrl'); }); + it('动态列表映射必须保留视频字段,且视频点击不得冒泡跳转详情', () => { + expect(api).toContain("videoUrl: p.videoUrl || ''"); + expect(api).toContain("videoCover: p.videoCover || ''"); + expect(community).toContain('@click.stop="stopPropagation"'); + }); + it('后台动态管理必须可预览短视频', () => { expect(admin).toContain('openVideoPreview'); expect(admin).toContain('record.videoUrl');