oak-frontend-base/es/utils/upload.js

37 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export class Upload {
async uploadFile(file, name, uploadUrl, formData, autoInform, getPercent, uploadId, // 新增上传任务ID用于中断特定上传
method = "POST") {
console.warn('server不会调用此函数');
}
controllers = new Map();
constructor() {
this.uploadFile = this.uploadFile.bind(this);
this.abortUpload = this.abortUpload.bind(this);
this.abortAllUploads = this.abortAllUploads.bind(this);
this.getUploadStatus = this.getUploadStatus.bind(this);
this.getActiveUploads = this.getActiveUploads.bind(this);
}
// 中断特定上传
abortUpload(uploadId) {
console.warn('server不会调用此函数');
return false;
}
// 中断所有上传
abortAllUploads() {
console.warn('server不会调用此函数');
}
// 获取上传状态
getUploadStatus(uploadId) {
console.warn('server不会调用此函数');
return 'uploading';
}
// 生成唯一的上传ID
generateUploadId(file, uploadUrl) {
return `server不会调用此函数`;
}
// 获取所有进行中的上传任务
getActiveUploads() {
return [];
}
}