换下小写试试 image.setAttribute(‘crossorgin’,’anonymous’) 将image作为文件读取blob流,ctx.toBlob 试试 export function imageToFileByCanvas(image: HTMLImageElement, fileName: string = "image.jpg"): Promise { const canvas = document.createElement("canvas") canvas.width = image.width canvas.height = image.height const ctx = canvas.getContext("2d")! ctx.drawImage(image, 0, 0) return new Promise(resolve => canvas.toBlob(blob => resolve(new File([blob!], fileName)))) } async function getImage(){ const file = await imageToFileByCanvas(image, "image.jpg") const imgUrl = URL.createObjectURL(file) // image 内存地址 } export function imageToFileByBlob(image: HTMLImageElement, fileName: string = "image.jpg") { const binStr = atob(image.src.split(",")[1]) const len = binStr.length const arr = new Uint8Array(len) for (let i = 0; i < len; i++) { arr[i] = binStr.charCodeAt(i) } const blob = new Blob([arr], { type: "image/png" }) return new File([blob], fileName) } [stackoverflow](https://link.segmentfault.com/?enc=kFtkQSkasHBMKuskptbbMg%3D%3D.R6llpqfI0vhSSR%2FNDd5nUCitYX2MAGg8PeXSAzGLkJm7pvs2VA5%2BsbGT6qCa%2B%2B%2FCd8DfZwRpj7NcUelaTo2jtjlO0yB2jm5NKMH5lHYZJNdz0Uu6xn8cYKQ6KJq55gs2)