This commit is contained in:
@@ -212,6 +212,8 @@ const bilutene_b = async () => {
|
||||
|
||||
const download = async () => {
|
||||
try {
|
||||
// Обрезаем заголовок до 200 символов для совместимости с именем файла на сервере
|
||||
const truncatedTitle = props.title.slice(0, 200);
|
||||
const rez = await axios.get(
|
||||
"https://allowlgroup.ru/api/8001/file_download",
|
||||
// "http://127.0.0.1:8001/file_download",
|
||||
@@ -219,7 +221,7 @@ const download = async () => {
|
||||
params: {
|
||||
// path: props.parsed_at.split(" ")[0].replace("-", "/"),
|
||||
path: props.article_date.split(" ")[0],
|
||||
title: props.title,
|
||||
title: truncatedTitle,
|
||||
},
|
||||
responseType: "blob",
|
||||
},
|
||||
@@ -230,7 +232,7 @@ const download = async () => {
|
||||
}),
|
||||
);
|
||||
const link = document.createElement("a");
|
||||
let filename = props.title + ".docx";
|
||||
let filename = truncatedTitle + ".docx";
|
||||
try {
|
||||
const disposition = rez.headers?.["content-disposition"];
|
||||
if (disposition) {
|
||||
|
||||
Reference in New Issue
Block a user