From 2836b0712f7813c1119b3e55620a7b17abf917b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=9D=B0?= <727475508@qq.com> Date: Wed, 6 May 2026 15:18:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=97=B6=E9=95=BF=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/albumUploadImage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/albumUploadImage.js b/utils/albumUploadImage.js index ae649cc..fda5fca 100644 --- a/utils/albumUploadImage.js +++ b/utils/albumUploadImage.js @@ -67,6 +67,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo // ========== 【核心新增:图片比例校验 结束】 ========== } else if (uploadType == 'video') { const res = await uni.chooseVideo({ + maxDuration:60, count: 1, sourceType: ['album', 'camera'], compressed: false @@ -77,6 +78,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo // #ifdef APP-PLUS || MP-WEIXIN file = res; // #endif + console.log(res,'resresres'); const duration = res.duration; if (duration < 3) { uni.showToast({ @@ -85,7 +87,7 @@ const handleUpload = async (userId, type, sourceType = ['album', 'camera'], uplo }); return null; } - if (duration > 59.9) { + if (duration > 61) { uni.showToast({ title: "视频时长不能超过1分钟", icon: "none",