Commit 67ea3df0 authored by GuanHua's avatar GuanHua

fix: 店铺上传宣传手册文件格式限制

parent 2ba42e4e
......@@ -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);
......
......@@ -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);
......
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