From 9364c299c6712070fa83b6464e4f82bbc3efce3c Mon Sep 17 00:00:00 2001 From: linju Date: Thu, 7 Nov 2024 17:02:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=83=85=E5=86=B5=E4=B8=8B=EF=BC=8C=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E5=B0=81=E9=9D=A2=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/config.js | 8 ++++---- components/uni-im-msg/types/video.vue | 23 +++++++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/common/config.js b/common/config.js index 39243b1..6e74d19 100644 --- a/common/config.js +++ b/common/config.js @@ -2,17 +2,17 @@ export default { // 云存储服务商 cloudFile:{ // 云存储服务商,支持:aliyun、tencent、qiniu - provider: 'qiniu', + provider: 'aliyun', }, uniPush: { // 消息渠道设置,避免被限量推送、静默推送(静音且需下拉系统通知栏才可见通知内容)详情文档:https://doc.dcloud.net.cn/uniCloud/uni-cloud-push/api.html#channel channel:{ // 渠道id - id: "114240", + id: "", // 消息渠道描述,会显示在手机系统关于当前应用的通知设置中 - desc: "客服消息" + desc: "" } }, // web端绑定的域名,用于生成二维码等 - domain: 'https://im.dcloud.net.cn', + domain: 'http://localhost:8080/', } \ No newline at end of file diff --git a/components/uni-im-msg/types/video.vue b/components/uni-im-msg/types/video.vue index c339c0d..6f5f075 100644 --- a/components/uni-im-msg/types/video.vue +++ b/components/uni-im-msg/types/video.vue @@ -58,21 +58,16 @@ this.videoPoster = '/uni_modules/uni-im/static/msg/video-uploading.gif' // #endif }else{ - // 文件存储的服务商 - const {provider} = config.cloudFile - switch (provider){ - case 'aliyun': - this.videoPoster = this.videoUrl + '?x-oss-process=video/snapshot,t_1000,f_jpg,w_200,m_fast,ar_auto' - break; - case 'tencent': - this.videoPoster = this.videoUrl + '?imageView2/0/w/200' - break; - case 'qiniu': - this.videoPoster = this.videoUrl + '?vframe/jpg/offset/1/w/200' - break; - default: - break; + // 如果链接带?号则加&否则加? + this.videoPoster = this.videoUrl + (this.videoUrl.indexOf('?') > -1 ? '&' : '?') + // 根据文件存储的服务商,传不同的参数获取视频封面 + const paramObj = { + aliyun: 'x-oss-process=video/snapshot,t_0,f_jpg,w_200,m_fast,ar_auto', + tencent: 'imageView2/0/w/200', + qiniu: 'vframe/jpg/offset/0/w/200' } + this.videoPoster += paramObj[config.cloudFile.provider] + console.log('this.videoPoster',this.videoPoster); } }, deep: true, -- GitLab