fix: rang drag problem & opt picture compress

This commit is contained in:
2025-09-08 12:13:14 +08:00
parent b5405c58a4
commit da7681e6e3
4 changed files with 104 additions and 15 deletions

View File

@@ -68,12 +68,12 @@ export default function UploadCover(props: UploadCoverProps) {
setVisible(false)
}, [value])
const onWxAdd = useCallback((images: CoverImageValue[], onFileUploaded: Promise<{ id: string, data: uploadFileResponseData }[]>) => {
const onWxAdd = useCallback((images: CoverImageValue[], onFileUpdate: Promise<{ id: string, url: string }[]>) => {
onAdd(images)
onFileUploaded.then(res => {
onFileUpdate.then(res => {
onAdd(res.map(item => ({
id: item.id,
url: item.data.file_path,
url: item.url,
})))
})
}, [onAdd])