From c088eda5b046c8cc1cebe51c6b132ad88f4fdf27 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Wed, 24 Nov 2021 18:07:09 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=A3=80=E6=B5=8B=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=98=AF=E5=90=A6=E4=B8=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=EF=BC=8C=E6=94=B9=E4=B8=BA=E8=AD=A6=E5=91=8A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/helpers/i18n/zh-Hans.json | 2 +- src/core/helpers/i18n/zh-Hant.json | 2 +- src/platforms/h5/service/api/media/choose-file.js | 10 ++++------ src/platforms/h5/service/api/media/choose-image.js | 10 ++++------ src/platforms/h5/service/api/media/choose-video.js | 10 ++++------ 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/core/helpers/i18n/zh-Hans.json b/src/core/helpers/i18n/zh-Hans.json index fb4e12f0e..60f7d0674 100644 --- a/src/core/helpers/i18n/zh-Hans.json +++ b/src/core/helpers/i18n/zh-Hans.json @@ -12,7 +12,7 @@ "uni.chooseVideo.cancel": "取消", "uni.chooseVideo.sourceType.album": "从相册选择", "uni.chooseVideo.sourceType.camera": "拍摄", - "uni.chooseFile.notUserActivation": "文件选择器对话框只能在用户激活时显示", + "uni.chooseFile.notUserActivation": "文件选择器对话框只能在由用户激活时显示", "uni.previewImage.cancel": "取消", "uni.previewImage.button.save": "保存图像", "uni.previewImage.save.success": "保存图像到相册成功", diff --git a/src/core/helpers/i18n/zh-Hant.json b/src/core/helpers/i18n/zh-Hant.json index a973aa517..efa81d855 100644 --- a/src/core/helpers/i18n/zh-Hant.json +++ b/src/core/helpers/i18n/zh-Hant.json @@ -12,7 +12,7 @@ "uni.chooseVideo.cancel": "取消", "uni.chooseVideo.sourceType.album": "從相冊選擇", "uni.chooseVideo.sourceType.camera": "拍攝", - "uni.chooseFile.notUserActivation": "文件選擇器對話框只能在用戶激活時顯示", + "uni.chooseFile.notUserActivation": "文件選擇器對話框只能在由用戶激活時顯示", "uni.previewImage.cancel": "取消", "uni.previewImage.button.save": "保存圖像", "uni.previewImage.save.success": "保存圖像到相冊成功", diff --git a/src/platforms/h5/service/api/media/choose-file.js b/src/platforms/h5/service/api/media/choose-file.js index c4d681161..89339a5eb 100644 --- a/src/platforms/h5/service/api/media/choose-file.js +++ b/src/platforms/h5/service/api/media/choose-file.js @@ -57,11 +57,9 @@ export function chooseFile ({ // TODO 用户取消选择时,触发 fail,目前尚未找到合适的方法。 }) - if (interact.getStatus()) { - fileInput.click() - } else { - invoke(callbackId, { - errMsg: `chooseFile:fail ${t('uni.chooseFile.notUserActivation')}` - }) + fileInput.click() + + if (!interact.getStatus()) { + console.warn(`${t('uni.chooseFile.notUserActivation')}`) } } diff --git a/src/platforms/h5/service/api/media/choose-image.js b/src/platforms/h5/service/api/media/choose-image.js index d54481bb6..682dc41c4 100644 --- a/src/platforms/h5/service/api/media/choose-image.js +++ b/src/platforms/h5/service/api/media/choose-image.js @@ -55,11 +55,9 @@ export function chooseImage ({ // TODO 用户取消选择时,触发 fail,目前尚未找到合适的方法。 }) - if (interact.getStatus()) { - imageInput.click() - } else { - invoke(callbackId, { - errMsg: `chooseImage:fail ${t('uni.chooseFile.notUserActivation')}` - }) + imageInput.click() + + if (!interact.getStatus()) { + console.warn(`${t('uni.chooseFile.notUserActivation')}`) } } diff --git a/src/platforms/h5/service/api/media/choose-video.js b/src/platforms/h5/service/api/media/choose-video.js index b30aa8362..a4d4ec44c 100644 --- a/src/platforms/h5/service/api/media/choose-video.js +++ b/src/platforms/h5/service/api/media/choose-video.js @@ -69,11 +69,9 @@ export function chooseVideo ({ // TODO 用户取消选择时,触发 fail,目前尚未找到合适的方法。 }) - if (interact.getStatus()) { - videoInput.click() - } else { - invoke(callbackId, { - errMsg: `chooseVideo:fail ${t('uni.chooseFile.notUserActivation')}` - }) + videoInput.click() + + if (!interact.getStatus()) { + console.warn(`${t('uni.chooseFile.notUserActivation')}`) } } -- GitLab