opt
This commit is contained in:
		
							parent
							
								
									5771dbd8a5
								
							
						
					
					
						commit
						080d30ef42
					
				
							
								
								
									
										13
									
								
								src/App.tsx
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/App.tsx
									
									
									
									
									
								
							@ -97,9 +97,16 @@ const ImageWatermark = ({
 | 
			
		||||
    if (confirm("确定下载图片?")) {
 | 
			
		||||
      const canvas = canvasRef.current!;
 | 
			
		||||
      const a = document.createElement("a");
 | 
			
		||||
      a.href = canvas.toDataURL("image/png");
 | 
			
		||||
      a.download = file.name;
 | 
			
		||||
      a.click();
 | 
			
		||||
      canvas.toBlob((blob) => {
 | 
			
		||||
        if (blob) {
 | 
			
		||||
          a.href = URL.createObjectURL(blob);
 | 
			
		||||
          a.download = file.name;
 | 
			
		||||
          a.click();
 | 
			
		||||
          setTimeout(() => {
 | 
			
		||||
            URL.revokeObjectURL(a.href);
 | 
			
		||||
          }, 1000 * 60);
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user