From 199d545cdd087291eaa8b5d9108e8c204b974209 Mon Sep 17 00:00:00 2001 From: Tony Yang Date: Sun, 2 Jun 2019 03:27:19 +0800 Subject: [PATCH] send FormData directly instead of URLSearchParams --- include/js/account.js | 3 +-- include/js/edit.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/js/account.js b/include/js/account.js index a62c6d7..8d1f60e 100644 --- a/include/js/account.js +++ b/include/js/account.js @@ -60,10 +60,9 @@ function eventListenerInitialize (form, inputs) { return undefined; } - let fd = new URLSearchParams(new FormData(this)).toString(); axios.request({ method: "POST", - data: fd, + data: new FormData(this), url: "account.php", headers: { 'Content-Type': "application/x-www-form-urlencoded" diff --git a/include/js/edit.js b/include/js/edit.js index f760c04..78527eb 100644 --- a/include/js/edit.js +++ b/include/js/edit.js @@ -121,10 +121,9 @@ function loadDraft() { $(document.edit).on('submit', function(e) { e.preventDefault(); var _this = this; - let fd = new URLSearchParams(new FormData(this)).toString(); axios.request({ method: "POST", - data: fd, + data: new FormData(this), url: "post.php", headers: { 'Content-Type': "application/x-www-form-urlencoded"