Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
merchant-manage-ui
Commits
71be248b
Commit
71be248b
authored
Apr 20, 2021
by
王苓芝
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件格式bug修改
parent
295f309b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
upload.jsx
src/pages/components/upload.jsx
+6
-9
No files found.
src/pages/components/upload.jsx
View file @
71be248b
...
...
@@ -22,7 +22,6 @@ class PicturesWall extends React.Component {
previewVisible
:
false
,
previewImage
:
''
,
fileList
:
[],
isValid
:
false
,
};
async
componentDidMount
()
{
...
...
@@ -44,21 +43,19 @@ class PicturesWall extends React.Component {
};
beforeUpload
=
file
=>
{
console
.
log
(
'
info
'
,
file
);
const
types
=
[
'
application/pdf
'
,
'
image/png
'
,
'
image/jpeg
'
];
if
(
types
.
indexOf
(
file
.
type
)
===
-
1
)
{
this
.
setState
({
isValid
:
false
});
message
.
error
(
'
输入格式有问题
'
);
}
return
types
.
indexOf
(
file
.
type
)
!
==
-
1
;
return
types
.
indexOf
(
file
.
type
)
=
==
-
1
;
};
handleChange
=
info
=>
{
console
.
log
(
'
info
'
,
info
.
file
);
if
(
!
this
.
state
.
isValid
)
{
this
.
setState
({
fileList
:
[]
});
return
;
}
this
.
setState
({
fileList
:
info
.
fileList
});
console
.
log
(
'
info-handleChange
'
,
info
.
fileList
);
const
types
=
[
'
application/pdf
'
,
'
image/png
'
,
'
image/jpeg
'
];
const
fileList
=
info
.
fileList
.
filter
(
item
=>
types
.
indexOf
(
item
.
type
)
!==
-
1
);
this
.
setState
({
fileList
});
};
customRequest
=
({
file
,
onError
,
onSuccess
})
=>
{
...
...
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