send FormData directly instead of URLSearchParams

This commit is contained in:
Tony Yang
2019-06-02 03:27:19 +08:00
parent e4f4545ad3
commit 199d545cdd
2 changed files with 2 additions and 4 deletions

View File

@@ -60,10 +60,9 @@ function eventListenerInitialize (form, inputs) {
return undefined; return undefined;
} }
let fd = new URLSearchParams(new FormData(this)).toString();
axios.request({ axios.request({
method: "POST", method: "POST",
data: fd, data: new FormData(this),
url: "account.php", url: "account.php",
headers: { headers: {
'Content-Type': "application/x-www-form-urlencoded" 'Content-Type': "application/x-www-form-urlencoded"

View File

@@ -121,10 +121,9 @@ function loadDraft() {
$(document.edit).on('submit', function(e) { $(document.edit).on('submit', function(e) {
e.preventDefault(); e.preventDefault();
var _this = this; var _this = this;
let fd = new URLSearchParams(new FormData(this)).toString();
axios.request({ axios.request({
method: "POST", method: "POST",
data: fd, data: new FormData(this),
url: "post.php", url: "post.php",
headers: { headers: {
'Content-Type': "application/x-www-form-urlencoded" 'Content-Type': "application/x-www-form-urlencoded"