This commit is contained in:
huangjx
2022-05-31 11:53:08 +08:00
parent 641ac432d0
commit a0321d67e4

View File

@@ -147,7 +147,10 @@ export const Http = class {
} }
upload(file: File) { upload(file: File) {
const fd = new FormData(); const fd = new FormData();
this.client = new XMLHttpRequest();
this.client.open(this.method, this.url, true); this.client.open(this.method, this.url, true);
this.setHeader('requesttoken', this.getToken())
this.setHeader('OCS-APIREQUEST', 'true')
let callback = this.handler; let callback = this.handler;
this.client.onload = () => { this.client.onload = () => {
if (typeof callback === 'function') if (typeof callback === 'function')