Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3dce3c3d
authored
Apr 01, 2026
by
yancanhua
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: 文件上传限制
1 parent
6f9f2550
Pipeline
#162
for
3dce3c3d
failed
in 0 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelectAndImageUpload.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/customizeUploadFile.vue
apps/web/venus-usedcar-quality/src/components/CustomizeForm/buttonSelectAndImageUpload.vue
View file @
3dce3c3
...
@@ -47,9 +47,10 @@ async function onFileChange(ev: Event) {
...
@@ -47,9 +47,10 @@ async function onFileChange(ev: Event) {
const
file
=
input
.
files
?.[
0
];
const
file
=
input
.
files
?.[
0
];
input
.
value
=
""
;
input
.
value
=
""
;
if
(
!
file
)
return
;
if
(
!
file
)
return
;
const
fileSize
=
file
.
size
/
1024
/
1024
;
const
maxSize10MB
=
10
*
1024
*
1024
;
if
(
fileSize
&&
fileSize
>
5
)
{
if
(
file
.
size
>
maxSize10MB
)
{
return
showToast
(
`文件大小不能超过5MB`
);
showToast
(
"文件大小不能超过10MB"
);
return
;
}
}
uploading
.
value
=
true
;
uploading
.
value
=
true
;
try
{
try
{
...
...
apps/web/venus-usedcar-quality/src/components/CustomizeForm/customizeUploadFile.vue
View file @
3dce3c3
...
@@ -48,16 +48,16 @@ async function onFileChange(ev: Event) {
...
@@ -48,16 +48,16 @@ async function onFileChange(ev: Event) {
const
file
=
input
.
files
?.[
0
];
const
file
=
input
.
files
?.[
0
];
input
.
value
=
""
;
input
.
value
=
""
;
if
(
!
file
)
return
;
if
(
!
file
)
return
;
const
fileSize
=
file
.
size
/
1024
/
1024
;
const
maxSize10MB
=
10
*
1024
*
1024
;
// 检查文件大小是否超过限制 10MB
const
maxSize100MB
=
100
*
1024
*
1024
;
if
(
props
.
item
.
interactionType
==
'image_upload'
&&
fileSize
&&
fileSize
>
5
)
{
if
(
props
.
item
.
interactionType
==
'image_upload'
&&
file
.
size
>
maxSize10MB
)
{
return
showToast
(
`文件大小不能超过5MB`
);;
showToast
(
"文件大小不能超过10MB"
);
return
;
}
}
// 检查文件大小是否超过限制 10MB
if
(
props
.
item
.
interactionType
==
'video_upload'
&&
file
.
size
>
maxSize100MB
)
{
if
(
props
.
item
.
interactionType
==
'video_upload'
&&
fileSize
&&
fileSize
>
100
)
{
showToast
(
"文件大小不能超过100MB"
);
return
showToast
(
`文件大小不能超过100MB`
)
;
return
;
}
}
uploading
.
value
=
true
;
uploading
.
value
=
true
;
try
{
try
{
const
res
=
await
uploadFile
(
file
);
const
res
=
await
uploadFile
(
file
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment