diff --git a/static/src/app/methods/upload.ts b/static/src/app/methods/upload.ts index ba548862..a08f4fb2 100644 --- a/static/src/app/methods/upload.ts +++ b/static/src/app/methods/upload.ts @@ -78,6 +78,11 @@ export const uploadMethods = { } const list = this.normalizeLocalFiles(files); if (!list.length) { + this.uiPushToast({ + title: '未获取到文件', + message: '系统未返回有效的文件内容,请重试', + type: 'warning' + }); return; } const existingCount = Array.isArray(this.selectedImages) ? this.selectedImages.length : 0; @@ -139,6 +144,11 @@ export const uploadMethods = { } const list = this.normalizeLocalFiles(files); if (!list.length) { + this.uiPushToast({ + title: '未获取到文件', + message: '系统未返回有效的文件内容,请重试', + type: 'warning' + }); return; } const valid = list.filter((file) => this.isVideoFile(file)); diff --git a/static/src/components/overlay/ImagePicker.vue b/static/src/components/overlay/ImagePicker.vue index f58d74f5..59520b52 100644 --- a/static/src/components/overlay/ImagePicker.vue +++ b/static/src/components/overlay/ImagePicker.vue @@ -117,7 +117,11 @@ const triggerLocal = () => { const onLocalChange = (event: Event) => { const target = event.target as HTMLInputElement; - emit('local-files', target?.files || null); + const files = target?.files || null; + if (!files || files.length === 0) { + console.warn('[ImagePicker] change fired but files empty — likely WebView compat issue'); + } + emit('local-files', files); if (target) { target.value = ''; } diff --git a/static/src/components/overlay/VideoPicker.vue b/static/src/components/overlay/VideoPicker.vue index 2626320b..1013c0c1 100644 --- a/static/src/components/overlay/VideoPicker.vue +++ b/static/src/components/overlay/VideoPicker.vue @@ -119,7 +119,11 @@ const triggerLocal = () => { const onLocalChange = (event: Event) => { const target = event.target as HTMLInputElement; - emit('local-files', target?.files || null); + const files = target?.files || null; + if (!files || files.length === 0) { + console.warn('[VideoPicker] change fired but files empty — likely WebView compat issue'); + } + emit('local-files', files); if (target) { target.value = ''; } diff --git a/static/src/styles/components/input/_composer.scss b/static/src/styles/components/input/_composer.scss index 7d2cb6fc..b5e98e32 100644 --- a/static/src/styles/components/input/_composer.scss +++ b/static/src/styles/components/input/_composer.scss @@ -805,7 +805,11 @@ body[data-theme='light'] { } .file-input-hidden { - display: none; + position: absolute; + opacity: 0; + width: 0; + height: 0; + pointer-events: none; } .quick-menu {