mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
fix upload
This commit is contained in:
parent
4efc7318ba
commit
061e803805
|
|
@ -55,7 +55,7 @@ export class AppNotification
|
||||||
output.querySelector('.log-msg-content').innerHTML = msg.message;
|
output.querySelector('.log-msg-content').innerHTML = msg.message;
|
||||||
|
|
||||||
tpl.parentNode.appendChild(output);
|
tpl.parentNode.appendChild(output);
|
||||||
window.navigator.vibrate(meg.vibrate ? 200 : 0);
|
window.navigator.vibrate(msg.vibrate ? 200 : 0);
|
||||||
|
|
||||||
setTimeout(function ()
|
setTimeout(function ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ export class Request
|
||||||
return 'application/x-www-form-urlencoded';
|
return 'application/x-www-form-urlencoded';
|
||||||
case RequestType.FILE:
|
case RequestType.FILE:
|
||||||
return '';
|
return '';
|
||||||
|
case RequestType.FORM_DATA:
|
||||||
|
return 'multipart/form-data';
|
||||||
default:
|
default:
|
||||||
return 'text/plain';
|
return 'text/plain';
|
||||||
}
|
}
|
||||||
|
|
@ -386,6 +388,8 @@ export class Request
|
||||||
this.xhr.send(this.data);
|
this.xhr.send(this.data);
|
||||||
} else if (this.type === RequestType.URL_ENCODE) {
|
} else if (this.type === RequestType.URL_ENCODE) {
|
||||||
this.xhr.send(this.queryfy(this.data));
|
this.xhr.send(this.queryfy(this.data));
|
||||||
|
} else if (this.type === RequestType.FORM_DATA) {
|
||||||
|
this.xhr.send(this.data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,6 @@ export const RequestType = Object.freeze({
|
||||||
JSON: 'json',
|
JSON: 'json',
|
||||||
RAW: 'raw',
|
RAW: 'raw',
|
||||||
FILE: 'file',
|
FILE: 'file',
|
||||||
URL_ENCODE: 'url'
|
URL_ENCODE: 'url',
|
||||||
|
FORM_DATA: 'formdata'
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,11 @@ export class FormView
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < externalLength; ++i) {
|
for (let i = 0; i < externalLength; ++i) {
|
||||||
|
if (form.contains(external[i])) {
|
||||||
|
delete external[i];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((external[i].type === 'checkbox' || external[i].type === 'radio') && !external[i].checked) {
|
if ((external[i].type === 'checkbox' || external[i].type === 'radio') && !external[i].checked) {
|
||||||
delete external[i];
|
delete external[i];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user