Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
uc_card
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
zhoujun
uc_card
Commits
118fc91b
Commit
118fc91b
authored
Jun 08, 2021
by
liyadong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
43533492
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
src/resources/views/card/card.blade.php
src/resources/views/card/card.blade.php
+13
-10
No files found.
src/resources/views/card/card.blade.php
View file @
118fc91b
...
...
@@ -206,19 +206,22 @@
$
(
document
).
on
(
'
change
'
,
'
#file
'
,
function
(
e
)
{
var
formData
=
new
FormData
();
var
file
=
$
(
"
#file
"
)[
0
].
files
[
0
];
console
.
log
(
file
)
var
acceptFileTypes
=
/^image
\/(
gif|jpe
?
g|png
)
$/i
;
var
roleId
=
getQueryString
(
'
roleId
'
);
var
serverId
=
getQueryString
(
'
serverId
'
);
// //文件类型判断
// if (file.type && !acceptFileTypes.test(file.type)) {
// alert('请上传jpg、jpeg或png格式的文件');
// return false;
// }
//文件大小判断
if
(
file
.
size
>
(
2
*
1024
*
1024
))
{
alert
(
'
请上传不超过2M的文件
'
);
return
false
;
try
{
// //文件类型判断
if
(
file
&&
file
.
type
&&
!
acceptFileTypes
.
test
(
file
.
type
))
{
alert
(
'
请上传jpg、jpeg或png格式的文件
'
);
return
false
;
}
//文件大小判断
if
(
file
&&
file
.
size
>
(
2
*
1024
*
1024
))
{
alert
(
'
请上传不超过2M的文件
'
);
return
false
;
}
}
catch
(
e
)
{
console
.
log
(
e
)
}
formData
.
append
(
"
imgFile
"
,
file
);
formData
.
append
(
"
roleId
"
,
roleId
);
...
...
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