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
853f4e4d
Commit
853f4e4d
authored
Aug 06, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 创建店铺上传文件问题
parent
ee60296b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
index.tsx
src/pages/channel/channelInfo/index.tsx
+3
-3
index.tsx
src/pages/shop/shopInfo/index.tsx
+4
-4
No files found.
src/pages/channel/channelInfo/index.tsx
View file @
853f4e4d
...
...
@@ -49,18 +49,16 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
const
PDFList
=
[
'application/pdf'
]
const
isPDF
=
PDFList
.
includes
(
file
.
type
)
if
(
!
isLt50M
)
{
setFileLoading
(
false
);
message
.
error
(
'上传文件大小不超过 50M!'
);
}
if
(
!
isPDF
)
{
setFileLoading
(
false
);
message
.
error
(
'请上传pdf格式文件'
);
}
return
isLt50M
&&
isPDF
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
if
(
file
.
response
)
{
setFileLoading
(
true
);
if
(
file
.
response
.
code
!==
1000
)
{
setFileLoading
(
false
);
return
...
...
@@ -70,6 +68,8 @@ const ChannelInfo: React.FC<ShopInfoPropsType> = (props) => {
albumName
:
file
.
name
,
albumUrl
:
file
.
response
.
data
,
})
}
else
{
setFileLoading
(
false
);
}
}
const
fileRemove
=
()
=>
{
...
...
src/pages/shop/shopInfo/index.tsx
View file @
853f4e4d
...
...
@@ -49,18 +49,16 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
const
PDFList
=
[
'application/pdf'
]
const
isPDF
=
PDFList
.
includes
(
file
.
type
)
if
(
!
isLt50M
)
{
setFileLoading
(
false
);
message
.
error
(
'上传文件大小不超过 50M!'
);
}
if
(
!
isPDF
)
{
setFileLoading
(
false
);
message
.
error
(
'请上传pdf格式文件'
);
}
return
isLt50M
&&
isPDF
;
}
const
handleChange
=
({
file
})
=>
{
setFileLoading
(
true
);
if
(
file
.
response
)
{
setFileLoading
(
true
);
if
(
file
.
response
.
code
!==
1000
)
{
setFileLoading
(
false
);
return
...
...
@@ -70,6 +68,8 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
albumName
:
file
.
name
,
albumUrl
:
file
.
response
.
data
,
})
}
else
{
setFileLoading
(
false
);
}
}
const
fileRemove
=
()
=>
{
...
...
@@ -433,7 +433,7 @@ const ShopInfo: React.FC<ShopInfoPropsType> = (props) => {
action=
"/api/file/file/upload"
data=
{
{
fileType
:
UPLOAD_TYPE
}
}
showUploadList=
{
false
}
accept=
'.pdf'
//
accept='.pdf'
beforeUpload=
{
beforeDocUpload
}
onChange=
{
handleChange
}
>
...
...
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