Download the way

1. Run window.open

window.open(url)
Copy the code

2. A label download

<a href={url} target="_blank" rel="noopener noreferrer">Copy the code

3. Create a tag to download dynamically

let a = document.createElement('a');
a.setAttribute('href', fileUrl);
a.setAttribute('download', 'filename');
a.click();
Copy the code

Download failure Cause

1. Cross-domain, as shown in the figure below

2. HTTPS domain names cannot access HTTP links, as shown in the following figure