Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
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
shenshaokai
jinfa-platform
Commits
67ea3df0
Commit
67ea3df0
authored
Aug 03, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 店铺上传宣传手册文件格式限制
parent
2ba42e4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
index.tsx
src/pages/channel/channelInfo/index.tsx
+6
-1
index.tsx
src/pages/shop/shopInfo/index.tsx
+6
-1
No files found.
src/pages/channel/channelInfo/index.tsx
View file @
67ea3df0
...
...
@@ -46,10 +46,15 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
[
fileLoading
,
setFileLoading
]
=
useState
<
boolean
>
(
false
);
const
beforeDocUpload
=
(
file
:
any
)
=>
{
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
;
const
PDFList
=
[
'application/pdf'
]
const
isPDF
=
PDFList
.
includes
(
file
.
type
)
if
(
!
isLt50M
)
{
message
.
error
(
'上传文件大小不超过 50M!'
);
}
return
isLt50M
;
if
(
!
isPDF
)
{
message
.
error
(
'请上传pdf格式文件'
);
}
return
isLt50M
&&
isPDF
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
...
...
src/pages/shop/shopInfo/index.tsx
View file @
67ea3df0
...
...
@@ -46,10 +46,15 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
[
fileLoading
,
setFileLoading
]
=
useState
<
boolean
>
(
false
);
const
beforeDocUpload
=
(
file
:
any
)
=>
{
const
isLt50M
=
file
.
size
/
1024
/
1024
<
50
;
const
PDFList
=
[
'application/pdf'
]
const
isPDF
=
PDFList
.
includes
(
file
.
type
)
if
(
!
isLt50M
)
{
message
.
error
(
'上传文件大小不超过 50M!'
);
}
return
isLt50M
;
if
(
!
isPDF
)
{
message
.
error
(
'请上传pdf格式文件'
);
}
return
isLt50M
&&
isPDF
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
...
...
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