diff --git a/internal/web/ui/templates/face_gallery.html b/internal/web/ui/templates/face_gallery.html index dce1ecc..52d8a56 100644 --- a/internal/web/ui/templates/face_gallery.html +++ b/internal/web/ui/templates/face_gallery.html @@ -92,7 +92,9 @@ function showEdit(id,name,photos){ } function delPhoto(id){ if(!confirm('确认删除这张照片?'))return; - fetch('/ui/face-gallery/delete-photo',{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body:'id='+id}).then(function(){window.location.reload();}); + var f=document.createElement('form');f.method='post';f.action='/ui/face-gallery/delete-photo'; + var i=document.createElement('input');i.type='hidden';i.name='id';i.value=id;f.appendChild(i); + document.body.appendChild(f);f.submit(); } function closeModal(){document.getElementById('modal').style.display='none';} document.addEventListener('click',function(e){var b=e.target.closest('.edit-btn');if(b){showEdit(b.dataset.id,b.dataset.name,JSON.parse(b.dataset.photos));}});