From 3f511dbc26b4567a53e6a4ea0440e7369905c584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E8=88=AA?= Date: Fri, 19 Dec 2025 16:26:47 +0800 Subject: [PATCH] =?UTF-8?q?JLBA202505130001=5F=E5=85=B3=E4=BA=8E=E5=90=89?= =?UTF-8?q?=E6=9E=97=E9=93=B6=E8=A1=8C=E6=96=B0=E5=BB=BAAI=E6=99=BA?= =?UTF-8?q?=E8=83=BD=E5=9F=B9=E8=AE=AD=E7=B3=BB=E7=BB=9F=E7=9A=84=E9=9C=80?= =?UTF-8?q?=E6=B1=82=5F=E4=B8=8A=E4=BC=A0=E5=A4=B1=E8=B4=A5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common.js | 8 ++++---- src/components/picture-upload/picture-upload.vue | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/api/common.js b/src/api/common.js index 3a75acb3..3468e2d5 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -25,20 +25,20 @@ export const uploadFile = (file, data) => { name: 'file', formData: data, success(result) { + console.log('result', result); try { const res = JSON.parse(result.data); if (res.rtnCode === '0000') { resolve(res.body); } else { - reject(new Error(res.msg)); + reject(res.message); } } catch (error) { - reject(new Error('Failed to parse response')); + reject('上传失败!'); } }, fail(error) { - console.log('error', error); - reject(new Error('Upload failed')); + reject('上传失败!'); } }); }); diff --git a/src/components/picture-upload/picture-upload.vue b/src/components/picture-upload/picture-upload.vue index a01f55b0..2a5a7f26 100644 --- a/src/components/picture-upload/picture-upload.vue +++ b/src/components/picture-upload/picture-upload.vue @@ -113,14 +113,12 @@ }) => { const valid = tempFilePaths.every(url => { if (props.fileType.length === 0) return true; - console.log(url); const lastDotIndex = url.lastIndexOf('.') if (lastDotIndex === -1) return false; const extension = url.slice(lastDotIndex + 1).split('?')[0].toLowerCase() return props.fileType.includes(extension) }) if (!valid) return common.msg('您选择的图片格式有误。') - console.log(valid) const data = { bizScen: 'S3005' } @@ -129,8 +127,8 @@ fileList.push(...res.splice(0, props.limit - fileList.length)) emits('update:modelValue', fileList.map(res => res.fileId)) - }).catch(() => { - + }).catch((err) => { + common.msg(err) }) } })