提交 949f58be 作者: 龚洪江

修复:论坛发布

上级 9a4d5b36
.mediaContent{ .mediaContent{
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap;
.mediaItemWrap{ .mediaItemWrap{
position: relative; position: relative;
.mediaItem{ .mediaItem{
......
...@@ -38,6 +38,11 @@ export default function PublishMessage(props: Props) { ...@@ -38,6 +38,11 @@ export default function PublishMessage(props: Props) {
}, []); }, []);
//图片上传 //图片上传
const handleChange: UploadProps['onChange'] = (info) => { const handleChange: UploadProps['onChange'] = (info) => {
const isSize = (info.file as any).size / 1024 / 1024 < 5;
if (isSize) {
window.messageApi.error('上传文件最大5M');
return;
}
const isType = [ const isType = [
'video/mp4', 'video/mp4',
'video/avi', 'video/avi',
...@@ -190,7 +195,7 @@ export default function PublishMessage(props: Props) { ...@@ -190,7 +195,7 @@ export default function PublishMessage(props: Props) {
maxCount={1} maxCount={1}
headers={{ token: token }} headers={{ token: token }}
> >
{fileList.length >= 8 ? null : ( {fileList.length >= 9 ? null : (
<NImage src={uploadImg} alt='' width={100} height={100} /> <NImage src={uploadImg} alt='' width={100} height={100} />
)} )}
</Upload> </Upload>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论