提交 1b9e1bfe 作者: 翁进城

fix:…

fix: 【企业认证】上传营业执照限制可上传JPG、JPEG、BMP、GIF、PNG”格式图片,错误提示改成“请上传10M以内的JPG、JPEG、BMP、GIF、PNG格式图片”,上传大小限制为10M
上级 969ff207
...@@ -21,9 +21,13 @@ import Router from "next/router"; ...@@ -21,9 +21,13 @@ import Router from "next/router";
import { UserContext } from "~/lib/userProvider"; import { UserContext } from "~/lib/userProvider";
const beforeUpload = (file: RcFile) => { const beforeUpload = (file: RcFile) => {
const isJpgOrPng = file.type === "image/jpeg" || file.type === "image/png"; const isJpgOrPng =
file.type === "image/jpeg" ||
file.type === "image/png" ||
file.type === "image/bmp" ||
file.type === "image/gif"
if (!isJpgOrPng) { if (!isJpgOrPng) {
message.error("You can only upload JPG/PNG file!"); message.error("请上传10M以内的JPG、JPEG、BMP、GIF、PNG格式图片");
} }
//限制上传10M //限制上传10M
const isLt2M = file.size / 1024 / 1024 < 10; const isLt2M = file.size / 1024 / 1024 < 10;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论