Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
Overview
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
yaru
fgqyxxlr
Commits
ba8b1365
Commit
ba8b1365
authored
May 31, 2018
by
yangzhengze
Committed by
若依
May 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
!9 修复更改个人头像上传文件类型限定为图片。
Merge pull request !9 from yangzhengze/master
parents
4bc46c5f
5096b226
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/main/resources/templates/system/user/profile/avatar.html
+7
-2
No files found.
src/main/resources/templates/system/user/profile/avatar.html
View file @
ba8b1365
...
...
@@ -13,7 +13,7 @@
<div
class=
"action"
>
<div
class=
"new-contentarea tc"
>
<a
href=
"javascript:void(0)"
class=
"upload-img"
>
<label
for=
"avatar"
>
上传图像
</label>
</a>
<input
type=
"file"
class=
""
name=
"avatar"
id=
"avatar"
/>
<input
type=
"file"
class=
""
name=
"avatar"
id=
"avatar"
accept=
"image/*"
/>
</div>
<input
type=
"button"
id=
"btnCrop"
class=
"Btnsty_peyton"
value=
"裁切"
/>
<input
type=
"button"
id=
"btnZoomIn"
class=
"Btnsty_peyton"
value=
"+"
/>
...
...
@@ -37,7 +37,12 @@ $(window).load(function() {
var
reader
=
new
FileReader
();
reader
.
onload
=
function
(
e
)
{
options
.
imgSrc
=
e
.
target
.
result
;
cropper
=
$
(
'.imageBox'
).
cropbox
(
options
);
//根据MIME判断上传的文件是不是图片类型
if
((
options
.
imgSrc
).
indexOf
(
"image/"
)
==-
1
){
alert
(
"错误提示
\
n"
+
" 请上传图片类型!"
);
}
else
{
cropper
=
$
(
'.imageBox'
).
cropbox
(
options
);
}
}
reader
.
readAsDataURL
(
this
.
files
[
0
]);
})
...
...
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