Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
0aa4df0d
Commit
0aa4df0d
authored
Oct 25, 2021
by
杨梦雪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传图片大小限制
parent
521853ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/components/index/SignUp/referInfo.vue
src/components/index/SignUp/referInfo.vue
+7
-7
No files found.
src/components/index/SignUp/referInfo.vue
View file @
0aa4df0d
...
...
@@ -647,20 +647,20 @@ export default {
// 图片上传成功前钩子
beforeAvatarUpload
(
file
)
{
// console.log(file, "22
");
console
.
log
(
file
,
"
beforeImage
"
);
const
isJPG
=
file
.
type
===
"
image/jpg
"
;
const
isPng
=
file
.
type
===
"
image/png
"
;
const
isJPEG
=
file
.
type
===
"
image/jpeg
"
;
const
isLt
20M
=
file
.
size
/
1024
/
1024
<
3
0
;
if
(
file
==
null
)
{
const
isLt
10M
=
file
.
size
/
1024
/
1024
<
1
0
;
// console.log(isLt10M)
if
(
!
isJPG
&&
!
isPng
&&
!
isJPEG
)
{
this
.
$message
.
info
(
"
上传图片只能是 JPG,JPEG或png 格式!
"
);
}
if
(
!
isLt
2
0M
)
{
this
.
$message
.
info
(
"
上传图片大小不能超过
2
0MB!
"
);
if
(
!
isLt
1
0M
)
{
this
.
$message
.
info
(
"
上传图片大小不能超过
1
0MB!
"
);
}
return
(
isJPG
||
isPng
||
isJPEG
)
&&
isLt
2
0M
;
}
return
(
isJPG
||
isPng
||
isJPEG
)
&&
isLt
1
0M
;
},
handlePictureCardPreview
(
file
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment