diff --git a/src/core/helpers/i18n/zh-Hans.json b/src/core/helpers/i18n/zh-Hans.json index fb4e12f0e6d62d670352f3403a5d0ca807025c6e..60f7d067478b35d6e025fa0118516afb43286290 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 a973aa5175f464bd55c00366af0c491d8d1e6c1e..efa81d85508783855cc8ccd68081ee3f935d4352 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 c4d681161b246f2a0a9610a5e0fa67532c89d1c5..89339a5eb314d6ee73ea226c06d87badaaa74772 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 d54481bb65001d3d387be9833f6631135db5b3a8..682dc41c420582c2d9795b0094448b08729351d2 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 b30aa8362bf6cff30ce1d388185d892b896a879c..a4d4ec44c04889cfb61d798e64a7470ef5fc1df7 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')}`) } }