Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
XiTianSenMall
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
leiqingsong
XiTianSenMall
Commits
b5f24880
Commit
b5f24880
authored
Mar 22, 2021
by
leiqingsong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传头像大小限制
parent
b595199c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
modefyAvatar.vue
H5/src/views/modefyAvatar.vue
+5
-0
No files found.
H5/src/views/modefyAvatar.vue
View file @
b5f24880
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
:max-count=
"1"
:max-count=
"1"
:before-delete=
"onDeleteAvatar"
:before-delete=
"onDeleteAvatar"
:after-read=
"onRead"
:after-read=
"onRead"
:max-size=
"2 * 1024 * 1024"
@
oversize=
"onOversize"
>
>
<van-button
type=
"primary"
>
上传新头像
</van-button>
<van-button
type=
"primary"
>
上传新头像
</van-button>
</van-uploader>
</van-uploader>
...
@@ -59,6 +61,9 @@ export default {
...
@@ -59,6 +61,9 @@ export default {
}
}
});
});
},
},
onOversize
()
{
this
.
$toast
.
fail
(
"上传头像超过了2M的限制,请重新上传"
);
},
onRead
(
file
)
{
onRead
(
file
)
{
console
.
log
(
"读取到图片了"
,
file
);
console
.
log
(
"读取到图片了"
,
file
);
const
inviteCode
=
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
inviteCode
;
const
inviteCode
=
JSON
.
parse
(
localStorage
.
getItem
(
"user"
)).
inviteCode
;
...
...
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