Код: Выделить всё
axios({
url: url,
method: 'POST',
responseType: 'blob',
headers: {
authorization: `Bearer ${token}`,
},
// data: postData
}).then((response) => {
const href = URL.createObjectURL(response.data);
const link = document.createElement('a');
link.href = href;
link.setAttribute('download', filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(href);
//if (onDownloaded) onDownloaded(postData);
}).catch((err) => {
console.error("Download failed:", err.message);
});
Я проверяю свой URL-адрес, и это правда
Подробнее здесь: https://stackoverflow.com/questions/797 ... rver-error
Мобильная версия