close #1195 and fixed all file upload issues.
This commit is contained in:
parent
456a2befc0
commit
b9d2aeb46c
16
resources/assets/js/plugins/form.js
vendored
16
resources/assets/js/plugins/form.js
vendored
@ -229,7 +229,21 @@ export default class Form {
|
|||||||
submit() {
|
submit() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
axios[this.method](this.action, this.data())
|
let data = this.data();
|
||||||
|
let form_data = new FormData();
|
||||||
|
|
||||||
|
for (let key in data) {
|
||||||
|
form_data.append(key, data[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
axios({
|
||||||
|
method: this.method,
|
||||||
|
url: this.action,
|
||||||
|
data: form_data,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
})
|
||||||
.then(this.onSuccess.bind(this))
|
.then(this.onSuccess.bind(this))
|
||||||
.catch(this.onFail.bind(this));
|
.catch(this.onFail.bind(this));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user