From 2d3114a772eb355b59d4dc41b039f75914243e55 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Wed, 31 Dec 2025 17:20:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=BD=AC=E8=B4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/infra/file/FileForm.vue | 15 ++++++++++----- .../app/components/channel/WeixinChannelForm.vue | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/views/infra/file/FileForm.vue b/src/views/infra/file/FileForm.vue index 6beb188c..ade0ef01 100644 --- a/src/views/infra/file/FileForm.vue +++ b/src/views/infra/file/FileForm.vue @@ -3,12 +3,12 @@ + accept=".jpg, .png, .gif, .apk" drag> 将文件拖到此处,或 点击上传 - 提示:仅允许导入 jpg、png、gif 格式文件! + 提示:仅允许导入 jpg、png、gif、apk 格式文件! @@ -44,13 +44,18 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 文件上传之前进行压缩 */ const beforeUpload: UploadProps['beforeUpload'] = async (file: UploadRawFile) => { + console.log("type:", file.type); + // 验证文件类型 - const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] + const allowedTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'application/vnd.android.package-archive'] + const imageTypes = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif'] if (!allowedTypes.includes(file.type)) { - message.error('仅允许上传 jpg、png、gif 格式文件!') + message.error('仅允许上传 jpg、png、gif、apk 格式文件!') return false } - + if (!imageTypes.includes(file.type)) { + return file + } // 压缩图片 try { const compressed = await compressImage(file, 0.8) diff --git a/src/views/pay/app/components/channel/WeixinChannelForm.vue b/src/views/pay/app/components/channel/WeixinChannelForm.vue index 0551d6fe..78cae7ea 100644 --- a/src/views/pay/app/components/channel/WeixinChannelForm.vue +++ b/src/views/pay/app/components/channel/WeixinChannelForm.vue @@ -65,7 +65,8 @@ - + + v2 v3 @@ -207,6 +208,7 @@ const open = async (appId, code) => { if (data && data.id) { formData.value = data formData.value.config = JSON.parse(data.config) + state.currentTab = data.config.mchType } dialogTitle.value = !formData.value.id ? '创建支付渠道' : '编辑支付渠道' } finally {