From 807561b908eb0ec5081780ea3e0750b13728bdfe Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Fri, 8 May 2026 19:46:50 +0800 Subject: [PATCH] fix: use form POST instead of fetch for face gallery delete --- internal/web/ui/templates/face_gallery.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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));}});