Browse Source

fix: 2.0.9正式部署

version/2.0.9
WIN-UGQIHHLSKBB\EDY 2 months ago
parent
commit
37bfb103b1
  1. 12
      src/utils/download.ts

12
src/utils/download.ts

@ -6,15 +6,9 @@ export interface DownloadUrlItem {
} }
export function downloadFile(fileUrl: string, fileName: string): void { export function downloadFile(fileUrl: string, fileName: string): void {
if (fileUrl.indexOf('www.popi.art/media') >= 0 // if (fileUrl.includes('/media') && !fileUrl.startsWith('blob:')) {
|| fileUrl.indexOf('localhost:8080/media') >= 0 // fileUrl += fileUrl.includes('?') ? '&download=true' : '?download=true';
|| fileUrl.indexOf('localhost:4200/media') >= 0) { // }
if (fileUrl.indexOf('?') >= 0) {
fileUrl += '&download=true'
} else {
fileUrl += '?download=true';
}
}
const a = document.createElement('a'); const a = document.createElement('a');
a.style.display = 'none'; a.style.display = 'none';
a.href = fileUrl; a.href = fileUrl;

Loading…
Cancel
Save