Commit 853f4e4d authored by GuanHua's avatar GuanHua

fix: 创建店铺上传文件问题

parent ee60296b
......@@ -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 = () => {
......
......@@ -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}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment