上传头像逻辑优化

This commit is contained in:
禺狨 2023-03-27 17:42:22 +08:00
parent 3b1de0c250
commit 4558f63af8

View File

@ -44,7 +44,10 @@ export const UserInfoModel: React.FC<PropInterface> = ({ open, onCancel }) => {
authorization: "Bearer " + getToken(),
},
beforeUpload: (file) => {
const isPNG = file.type === ("image/png" || "image/jpg");
const isPNG =
file.type === "image/png" ||
file.type === "image/jpg" ||
file.type === "image/jpeg";
if (!isPNG) {
message.error(`${file.name}不是图片文件`);
}