chore: rebase main

This commit is contained in:
jialin
2024-11-22 10:00:34 +08:00
parent 419f1e07d1
commit a72088b7a8
2 changed files with 12 additions and 28 deletions
+1 -16
View File
@@ -3,7 +3,7 @@ import { useIntl } from '@umijs/max';
import { Button, Tooltip, Upload } from 'antd';
import type { UploadFile } from 'antd/es/upload';
import { RcFile } from 'antd/es/upload';
import { debounce, round } from 'lodash';
import { debounce } from 'lodash';
import React, { useCallback, useRef } from 'react';
interface UploadImgProps {
@@ -38,21 +38,6 @@ const UploadImg: React.FC<UploadImgProps> = ({
[handleUpdateImgList, intl]
);
const getImgDimensions = useCallback(
(file: any): Promise<{ ratio: number }> => {
return new Promise((resolve) => {
const img = new Image();
img.onload = () => {
resolve({ ratio: round(img.width / img.height, 2) });
};
img.onerror = () => {
resolve({ ratio: 1 });
};
img.src = URL.createObjectURL(file);
});
},
[]
);
const handleChange = useCallback(
async (info: any) => {
const { fileList } = info;