mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-06-08 04:58:58 +08:00
上传头像优化
This commit is contained in:
parent
7af9f1e761
commit
b6bee05379
@ -51,7 +51,11 @@ export const UserInfoModel: React.FC<PropInterface> = ({ open, onCancel }) => {
|
|||||||
if (!isPNG) {
|
if (!isPNG) {
|
||||||
message.error(`${file.name}不是图片文件`);
|
message.error(`${file.name}不是图片文件`);
|
||||||
}
|
}
|
||||||
return isPNG || Upload.LIST_IGNORE;
|
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||||
|
if (!isLt2M) {
|
||||||
|
message.error("超过2M限制,不允许上传");
|
||||||
|
}
|
||||||
|
return (isPNG && isLt2M) || Upload.LIST_IGNORE;
|
||||||
},
|
},
|
||||||
onChange(info: any) {
|
onChange(info: any) {
|
||||||
const { status, response } = info.file;
|
const { status, response } = info.file;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user