fix: use form POST instead of fetch for face gallery delete
This commit is contained in:
parent
c2588e7785
commit
807561b908
@ -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));}});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user