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;
}
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"

View File

@@ -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"