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');