tentando resolver problema do download do zip no mmpCreator
Deploy / Deploy (push) Successful in 1m22s Details

This commit is contained in:
JotaChina 2025-12-10 16:45:44 -03:00
parent 53fb3309fc
commit a64db2843c
1 changed files with 6 additions and 2 deletions

View File

@ -783,9 +783,13 @@
let projectName = params.get("project"); let projectName = params.get("project");
if (projectName) { if (projectName) {
// 2. Garante a extensão para a API (opcional, mas seguro)
if (!projectName.toLowerCase().endsWith(".mmp")) {
projectName += ".mmp";
}
// 3. Monta a URL da API Python e inicia o download // 3. Monta a URL da API Python e inicia o download
const apiUrl = `https://alice.ufsj.edu.br:33002/api/download/${projectName}`; const apiUrl = `/api/download/${projectName}`;
// Feedback visual rápido // Feedback visual rápido
downloadBtn.style.opacity = "0.5"; downloadBtn.style.opacity = "0.5";
@ -843,7 +847,7 @@
uploadSampleBtn.style.pointerEvents = "none"; uploadSampleBtn.style.pointerEvents = "none";
try { try {
const response = await fetch("https://alice.ufsj.edu.br:33002/api/upload/sample", { const response = await fetch("/api/upload/sample", {
method: "POST", method: "POST",
body: formData body: formData
}); });